{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Using Neighborhood Queries"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {
    "toc": true
   },
   "source": [
    "<h1><span class=\"tocSkip\"></span></h1>\n",
    "<div class=\"toc\"><ul class=\"toc-item\"><li><span><a href=\"#Setup-Network\" data-toc-modified-id=\"Setup-Network-1\">Setup Network</a></span></li><li><span><a href=\"#Find-Neighoring-Pores\" data-toc-modified-id=\"Find-Neighoring-Pores-2\">Find Neighoring Pores</a></span><ul class=\"toc-item\"><li><span><a href=\"#Find-All-Neighbors:-OR\" data-toc-modified-id=\"Find-All-Neighbors:-OR-2.1\">Find All Neighbors: OR</a></span></li><li><span><a href=\"#Find-Non-Shared-Neighbors:-XOR\" data-toc-modified-id=\"Find-Non-Shared-Neighbors:-XOR-2.2\">Find Non-Shared Neighbors: XOR</a></span></li><li><span><a href=\"#Find-Common-Neighbors-of-Two-Sets:-XNOR\" data-toc-modified-id=\"Find-Common-Neighbors-of-Two-Sets:-XNOR-2.3\">Find Common Neighbors of Two Sets: XNOR</a></span></li></ul></li><li><span><a href=\"#Find-Neighboring-Throats\" data-toc-modified-id=\"Find-Neighboring-Throats-3\">Find Neighboring Throats</a></span><ul class=\"toc-item\"><li><span><a href=\"#Find-All-Neighboring-Throats:-OR\" data-toc-modified-id=\"Find-All-Neighboring-Throats:-OR-3.1\">Find All Neighboring Throats: OR</a></span></li><li><span><a href=\"#Find-Common-Neighbors:-XNOR\" data-toc-modified-id=\"Find-Common-Neighbors:-XNOR-3.2\">Find Common Neighbors: XNOR</a></span></li><li><span><a href=\"#Find-Non-Shared-Neighbors:-XOR\" data-toc-modified-id=\"Find-Non-Shared-Neighbors:-XOR-3.3\">Find Non-Shared Neighbors: XOR</a></span></li></ul></li></ul></div>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2021-06-24T11:25:19.226715Z",
     "iopub.status.busy": "2021-06-24T11:25:19.224569Z",
     "iopub.status.idle": "2021-06-24T11:25:19.964845Z",
     "shell.execute_reply": "2021-06-24T11:25:19.963436Z"
    }
   },
   "outputs": [],
   "source": [
    "import openpnm as op\n",
    "%config InlineBackend.figure_formats = ['svg']\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "np.random.seed(10)\n",
    "%matplotlib inline\n",
    "ws = op.Workspace()\n",
    "ws.settings[\"loglevel\"] = 40"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Setup Network\n",
    "\n",
    "The OpenPNM *GenericNetwork* objects (e.g. Cubic, Voronoi, etc) have methods that let you query the connected pores and throats.  This tutorial will explain how these work and illustrate why they are useful."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2021-06-24T11:25:19.971951Z",
     "iopub.status.busy": "2021-06-24T11:25:19.970536Z",
     "iopub.status.idle": "2021-06-24T11:25:19.975403Z",
     "shell.execute_reply": "2021-06-24T11:25:19.974200Z"
    }
   },
   "outputs": [],
   "source": [
    "pn = op.network.Cubic(shape=[4, 4, 1])"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "The following examples are relatively trivial, but their intention is to illustrate the different functions and options.  More realistic use cases will be presented further down."
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Start by finding all pores on the 'left' and 'back'"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2021-06-24T11:25:19.982000Z",
     "iopub.status.busy": "2021-06-24T11:25:19.980755Z",
     "iopub.status.idle": "2021-06-24T11:25:19.983335Z",
     "shell.execute_reply": "2021-06-24T11:25:19.984331Z"
    }
   },
   "outputs": [],
   "source": [
    "P_left = pn.pores('left')\n",
    "P_bottom = pn.pores('back')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Find Neighoring Pores\n",
    "We now have two sets of pores that actually overlap each other, as illustrated below:"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2021-06-24T11:25:20.057812Z",
     "iopub.status.busy": "2021-06-24T11:25:20.056352Z",
     "iopub.status.idle": "2021-06-24T11:25:20.181894Z",
     "shell.execute_reply": "2021-06-24T11:25:20.183065Z"
    }
   },
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<svg height=\"262.19625pt\" version=\"1.1\" viewBox=\"0 0 385.78125 262.19625\" width=\"385.78125pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:date>2021-06-24T07:25:20.143989</dc:date>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Matplotlib v3.4.2, https://matplotlib.org/</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 262.19625 \n",
       "L 385.78125 262.19625 \n",
       "L 385.78125 0 \n",
       "L 0 0 \n",
       "z\n",
       "\" style=\"fill:none;\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 43.78125 224.64 \n",
       "L 378.58125 224.64 \n",
       "L 378.58125 7.2 \n",
       "L 43.78125 7.2 \n",
       "z\n",
       "\" style=\"fill:#ffffff;\"/>\n",
       "   </g>\n",
       "   <g id=\"PathCollection_1\">\n",
       "    <defs>\n",
       "     <path d=\"M 0 3.535534 \n",
       "C 0.937635 3.535534 1.836992 3.163008 2.5 2.5 \n",
       "C 3.163008 1.836992 3.535534 0.937635 3.535534 0 \n",
       "C 3.535534 -0.937635 3.163008 -1.836992 2.5 -2.5 \n",
       "C 1.836992 -3.163008 0.937635 -3.535534 0 -3.535534 \n",
       "C -0.937635 -3.535534 -1.836992 -3.163008 -2.5 -2.5 \n",
       "C -3.163008 -1.836992 -3.535534 -0.937635 -3.535534 0 \n",
       "C -3.535534 0.937635 -3.163008 1.836992 -2.5 2.5 \n",
       "C -1.836992 3.163008 -0.937635 3.535534 0 3.535534 \n",
       "z\n",
       "\" id=\"mdce1139424\" style=\"stroke:#d3d3d3;\"/>\n",
       "    </defs>\n",
       "    <g clip-path=\"url(#pc616a5973e)\">\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"112.344886\" xlink:href=\"#mdce1139424\" y=\"214.756364\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"112.344886\" xlink:href=\"#mdce1139424\" y=\"148.865455\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"112.344886\" xlink:href=\"#mdce1139424\" y=\"82.974545\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"112.344886\" xlink:href=\"#mdce1139424\" y=\"17.083636\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"178.235795\" xlink:href=\"#mdce1139424\" y=\"214.756364\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"178.235795\" xlink:href=\"#mdce1139424\" y=\"148.865455\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"178.235795\" xlink:href=\"#mdce1139424\" y=\"82.974545\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"178.235795\" xlink:href=\"#mdce1139424\" y=\"17.083636\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"244.126705\" xlink:href=\"#mdce1139424\" y=\"214.756364\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"244.126705\" xlink:href=\"#mdce1139424\" y=\"148.865455\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"244.126705\" xlink:href=\"#mdce1139424\" y=\"82.974545\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"244.126705\" xlink:href=\"#mdce1139424\" y=\"17.083636\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"310.017614\" xlink:href=\"#mdce1139424\" y=\"214.756364\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"310.017614\" xlink:href=\"#mdce1139424\" y=\"148.865455\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"310.017614\" xlink:href=\"#mdce1139424\" y=\"82.974545\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"310.017614\" xlink:href=\"#mdce1139424\" y=\"17.083636\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"PathCollection_2\">\n",
       "    <defs>\n",
       "     <path d=\"M 0 -3.535534 \n",
       "L -0.793777 -1.09254 \n",
       "L -3.362493 -1.09254 \n",
       "L -1.284358 0.417313 \n",
       "L -2.078135 2.860307 \n",
       "L -0 1.350454 \n",
       "L 2.078135 2.860307 \n",
       "L 1.284358 0.417313 \n",
       "L 3.362493 -1.09254 \n",
       "L 0.793777 -1.09254 \n",
       "z\n",
       "\" id=\"md711ff6b47\" style=\"stroke:#ff0000;\"/>\n",
       "    </defs>\n",
       "    <g clip-path=\"url(#pc616a5973e)\">\n",
       "     <use style=\"fill:#ff0000;stroke:#ff0000;\" x=\"112.344886\" xlink:href=\"#md711ff6b47\" y=\"214.756364\"/>\n",
       "     <use style=\"fill:#ff0000;stroke:#ff0000;\" x=\"112.344886\" xlink:href=\"#md711ff6b47\" y=\"148.865455\"/>\n",
       "     <use style=\"fill:#ff0000;stroke:#ff0000;\" x=\"112.344886\" xlink:href=\"#md711ff6b47\" y=\"82.974545\"/>\n",
       "     <use style=\"fill:#ff0000;stroke:#ff0000;\" x=\"112.344886\" xlink:href=\"#md711ff6b47\" y=\"17.083636\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"PathCollection_3\">\n",
       "    <defs>\n",
       "     <path d=\"M 0 1.767767 \n",
       "C 0.468817 1.767767 0.918496 1.581504 1.25 1.25 \n",
       "C 1.581504 0.918496 1.767767 0.468817 1.767767 0 \n",
       "C 1.767767 -0.468817 1.581504 -0.918496 1.25 -1.25 \n",
       "C 0.918496 -1.581504 0.468817 -1.767767 0 -1.767767 \n",
       "C -0.468817 -1.767767 -0.918496 -1.581504 -1.25 -1.25 \n",
       "C -1.581504 -0.918496 -1.767767 -0.468817 -1.767767 0 \n",
       "C -1.767767 0.468817 -1.581504 0.918496 -1.25 1.25 \n",
       "C -0.918496 1.581504 -0.468817 1.767767 0 1.767767 \n",
       "z\n",
       "\" id=\"m7d25b3ca9a\" style=\"stroke:#0000ff;\"/>\n",
       "    </defs>\n",
       "    <g clip-path=\"url(#pc616a5973e)\">\n",
       "     <use style=\"fill:#0000ff;stroke:#0000ff;\" x=\"112.344886\" xlink:href=\"#m7d25b3ca9a\" y=\"17.083636\"/>\n",
       "     <use style=\"fill:#0000ff;stroke:#0000ff;\" x=\"178.235795\" xlink:href=\"#m7d25b3ca9a\" y=\"17.083636\"/>\n",
       "     <use style=\"fill:#0000ff;stroke:#0000ff;\" x=\"244.126705\" xlink:href=\"#m7d25b3ca9a\" y=\"17.083636\"/>\n",
       "     <use style=\"fill:#0000ff;stroke:#0000ff;\" x=\"310.017614\" xlink:href=\"#m7d25b3ca9a\" y=\"17.083636\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L 0 3.5 \n",
       "\" id=\"mcfea3aaa6f\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"79.399432\" xlink:href=\"#mcfea3aaa6f\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- 0 -->\n",
       "      <g transform=\"translate(76.218182 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2034 4250 \n",
       "Q 1547 4250 1301 3770 \n",
       "Q 1056 3291 1056 2328 \n",
       "Q 1056 1369 1301 889 \n",
       "Q 1547 409 2034 409 \n",
       "Q 2525 409 2770 889 \n",
       "Q 3016 1369 3016 2328 \n",
       "Q 3016 3291 2770 3770 \n",
       "Q 2525 4250 2034 4250 \n",
       "z\n",
       "M 2034 4750 \n",
       "Q 2819 4750 3233 4129 \n",
       "Q 3647 3509 3647 2328 \n",
       "Q 3647 1150 3233 529 \n",
       "Q 2819 -91 2034 -91 \n",
       "Q 1250 -91 836 529 \n",
       "Q 422 1150 422 2328 \n",
       "Q 422 3509 836 4129 \n",
       "Q 1250 4750 2034 4750 \n",
       "z\n",
       "\" id=\"DejaVuSans-30\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_2\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"145.290341\" xlink:href=\"#mcfea3aaa6f\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- 1 -->\n",
       "      <g transform=\"translate(142.109091 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 794 531 \n",
       "L 1825 531 \n",
       "L 1825 4091 \n",
       "L 703 3866 \n",
       "L 703 4441 \n",
       "L 1819 4666 \n",
       "L 2450 4666 \n",
       "L 2450 531 \n",
       "L 3481 531 \n",
       "L 3481 0 \n",
       "L 794 0 \n",
       "L 794 531 \n",
       "z\n",
       "\" id=\"DejaVuSans-31\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"211.18125\" xlink:href=\"#mcfea3aaa6f\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- 2 -->\n",
       "      <g transform=\"translate(208 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 1228 531 \n",
       "L 3431 531 \n",
       "L 3431 0 \n",
       "L 469 0 \n",
       "L 469 531 \n",
       "Q 828 903 1448 1529 \n",
       "Q 2069 2156 2228 2338 \n",
       "Q 2531 2678 2651 2914 \n",
       "Q 2772 3150 2772 3378 \n",
       "Q 2772 3750 2511 3984 \n",
       "Q 2250 4219 1831 4219 \n",
       "Q 1534 4219 1204 4116 \n",
       "Q 875 4013 500 3803 \n",
       "L 500 4441 \n",
       "Q 881 4594 1212 4672 \n",
       "Q 1544 4750 1819 4750 \n",
       "Q 2544 4750 2975 4387 \n",
       "Q 3406 4025 3406 3419 \n",
       "Q 3406 3131 3298 2873 \n",
       "Q 3191 2616 2906 2266 \n",
       "Q 2828 2175 2409 1742 \n",
       "Q 1991 1309 1228 531 \n",
       "z\n",
       "\" id=\"DejaVuSans-32\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_4\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"277.072159\" xlink:href=\"#mcfea3aaa6f\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_4\">\n",
       "      <!-- 3 -->\n",
       "      <g transform=\"translate(273.890909 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2597 2516 \n",
       "Q 3050 2419 3304 2112 \n",
       "Q 3559 1806 3559 1356 \n",
       "Q 3559 666 3084 287 \n",
       "Q 2609 -91 1734 -91 \n",
       "Q 1441 -91 1130 -33 \n",
       "Q 819 25 488 141 \n",
       "L 488 750 \n",
       "Q 750 597 1062 519 \n",
       "Q 1375 441 1716 441 \n",
       "Q 2309 441 2620 675 \n",
       "Q 2931 909 2931 1356 \n",
       "Q 2931 1769 2642 2001 \n",
       "Q 2353 2234 1838 2234 \n",
       "L 1294 2234 \n",
       "L 1294 2753 \n",
       "L 1863 2753 \n",
       "Q 2328 2753 2575 2939 \n",
       "Q 2822 3125 2822 3475 \n",
       "Q 2822 3834 2567 4026 \n",
       "Q 2313 4219 1838 4219 \n",
       "Q 1578 4219 1281 4162 \n",
       "Q 984 4106 628 3988 \n",
       "L 628 4550 \n",
       "Q 988 4650 1302 4700 \n",
       "Q 1616 4750 1894 4750 \n",
       "Q 2613 4750 3031 4423 \n",
       "Q 3450 4097 3450 3541 \n",
       "Q 3450 3153 3228 2886 \n",
       "Q 3006 2619 2597 2516 \n",
       "z\n",
       "\" id=\"DejaVuSans-33\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"342.963068\" xlink:href=\"#mcfea3aaa6f\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- 4 -->\n",
       "      <g transform=\"translate(339.781818 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2419 4116 \n",
       "L 825 1625 \n",
       "L 2419 1625 \n",
       "L 2419 4116 \n",
       "z\n",
       "M 2253 4666 \n",
       "L 3047 4666 \n",
       "L 3047 1625 \n",
       "L 3713 1625 \n",
       "L 3713 1100 \n",
       "L 3047 1100 \n",
       "L 3047 0 \n",
       "L 2419 0 \n",
       "L 2419 1100 \n",
       "L 313 1100 \n",
       "L 313 1709 \n",
       "L 2253 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-34\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-34\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_6\">\n",
       "     <!-- X -->\n",
       "     <g transform=\"translate(207.75625 252.916562)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M 403 4666 \n",
       "L 1081 4666 \n",
       "L 2241 2931 \n",
       "L 3406 4666 \n",
       "L 4084 4666 \n",
       "L 2584 2425 \n",
       "L 4184 0 \n",
       "L 3506 0 \n",
       "L 2194 1984 \n",
       "L 872 0 \n",
       "L 191 0 \n",
       "L 1856 2491 \n",
       "L 403 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-58\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-58\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_6\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L -3.5 0 \n",
       "\" id=\"me1d69989c1\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#me1d69989c1\" y=\"214.756364\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_7\">\n",
       "      <!-- 0.5 -->\n",
       "      <g transform=\"translate(20.878125 218.555582)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 684 794 \n",
       "L 1344 794 \n",
       "L 1344 0 \n",
       "L 684 0 \n",
       "L 684 794 \n",
       "z\n",
       "\" id=\"DejaVuSans-2e\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 691 4666 \n",
       "L 3169 4666 \n",
       "L 3169 4134 \n",
       "L 1269 4134 \n",
       "L 1269 2991 \n",
       "Q 1406 3038 1543 3061 \n",
       "Q 1681 3084 1819 3084 \n",
       "Q 2600 3084 3056 2656 \n",
       "Q 3513 2228 3513 1497 \n",
       "Q 3513 744 3044 326 \n",
       "Q 2575 -91 1722 -91 \n",
       "Q 1428 -91 1123 -41 \n",
       "Q 819 9 494 109 \n",
       "L 494 744 \n",
       "Q 775 591 1075 516 \n",
       "Q 1375 441 1709 441 \n",
       "Q 2250 441 2565 725 \n",
       "Q 2881 1009 2881 1497 \n",
       "Q 2881 1984 2565 2268 \n",
       "Q 2250 2553 1709 2553 \n",
       "Q 1456 2553 1204 2497 \n",
       "Q 953 2441 691 2322 \n",
       "L 691 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-35\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_7\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#me1d69989c1\" y=\"181.810909\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_8\">\n",
       "      <!-- 1.0 -->\n",
       "      <g transform=\"translate(20.878125 185.610128)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_8\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#me1d69989c1\" y=\"148.865455\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_9\">\n",
       "      <!-- 1.5 -->\n",
       "      <g transform=\"translate(20.878125 152.664673)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_9\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#me1d69989c1\" y=\"115.92\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_10\">\n",
       "      <!-- 2.0 -->\n",
       "      <g transform=\"translate(20.878125 119.719219)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_5\">\n",
       "     <g id=\"line2d_10\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#me1d69989c1\" y=\"82.974545\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_11\">\n",
       "      <!-- 2.5 -->\n",
       "      <g transform=\"translate(20.878125 86.773764)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_6\">\n",
       "     <g id=\"line2d_11\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#me1d69989c1\" y=\"50.029091\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_12\">\n",
       "      <!-- 3.0 -->\n",
       "      <g transform=\"translate(20.878125 53.82831)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_7\">\n",
       "     <g id=\"line2d_12\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#me1d69989c1\" y=\"17.083636\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_13\">\n",
       "      <!-- 3.5 -->\n",
       "      <g transform=\"translate(20.878125 20.882855)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_14\">\n",
       "     <!-- Y -->\n",
       "     <g transform=\"translate(14.798438 118.973906)rotate(-90)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M -13 4666 \n",
       "L 666 4666 \n",
       "L 1959 2747 \n",
       "L 3244 4666 \n",
       "L 3922 4666 \n",
       "L 2272 2222 \n",
       "L 2272 0 \n",
       "L 1638 0 \n",
       "L 1638 2222 \n",
       "L -13 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-59\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-59\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path d=\"M 43.78125 224.64 \n",
       "L 43.78125 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path d=\"M 378.58125 224.64 \n",
       "L 378.58125 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path d=\"M 43.78125 224.64 \n",
       "L 378.58125 224.64 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path d=\"M 43.78125 7.2 \n",
       "L 378.58125 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"pc616a5973e\">\n",
       "   <rect height=\"217.44\" width=\"334.8\" x=\"43.78125\" y=\"7.2\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax = plt.subplots()\n",
    "op.topotools.plot_coordinates(pn, pn.Ps, c='lightgrey', \n",
    "                              markersize=50, ax=ax)\n",
    "op.topotools.plot_coordinates(pn, P_left, c='red', marker='*', \n",
    "                              markersize=50, ax=ax)\n",
    "op.topotools.plot_coordinates(pn, P_bottom, c='blue', marker='.', \n",
    "                              markersize=50, ax=ax)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "We'll merge these pores into a single set, and explore the different ways to find neighbors to this set.  Note that the pore at [x,y] = [1.5, 1.5] has two neighbors (one 'bottom' and one 'left'). "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Find All Neighbors: OR\n",
    "> *Finds all pores with one or more connections to the input pores*\n",
    "\n",
    "Given a set of pores, find the pores that are neighbors to one or more of the inputs.  This is called **OR** since it gives the neighbors of either the bottom pores *or* the left pores, *or* both.  "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2021-06-24T11:25:20.190991Z",
     "iopub.status.busy": "2021-06-24T11:25:20.189847Z",
     "iopub.status.idle": "2021-06-24T11:25:20.193782Z",
     "shell.execute_reply": "2021-06-24T11:25:20.194686Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[ 0  1  2  3  7 11 15]\n",
      "[ 4  5  6 10 14]\n"
     ]
    }
   ],
   "source": [
    "Ps = pn.pores(['left', 'back'])\n",
    "print(Ps)\n",
    "Ps = pn.find_neighbor_pores(pores=Ps, mode='or')\n",
    "print(Ps)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2021-06-24T11:25:20.223680Z",
     "iopub.status.busy": "2021-06-24T11:25:20.218772Z",
     "iopub.status.idle": "2021-06-24T11:25:20.339859Z",
     "shell.execute_reply": "2021-06-24T11:25:20.341020Z"
    }
   },
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<svg height=\"262.19625pt\" version=\"1.1\" viewBox=\"0 0 385.78125 262.19625\" width=\"385.78125pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:date>2021-06-24T07:25:20.303521</dc:date>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Matplotlib v3.4.2, https://matplotlib.org/</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 262.19625 \n",
       "L 385.78125 262.19625 \n",
       "L 385.78125 0 \n",
       "L 0 0 \n",
       "z\n",
       "\" style=\"fill:none;\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 43.78125 224.64 \n",
       "L 378.58125 224.64 \n",
       "L 378.58125 7.2 \n",
       "L 43.78125 7.2 \n",
       "z\n",
       "\" style=\"fill:#ffffff;\"/>\n",
       "   </g>\n",
       "   <g id=\"PathCollection_1\">\n",
       "    <defs>\n",
       "     <path d=\"M 0 3.535534 \n",
       "C 0.937635 3.535534 1.836992 3.163008 2.5 2.5 \n",
       "C 3.163008 1.836992 3.535534 0.937635 3.535534 0 \n",
       "C 3.535534 -0.937635 3.163008 -1.836992 2.5 -2.5 \n",
       "C 1.836992 -3.163008 0.937635 -3.535534 0 -3.535534 \n",
       "C -0.937635 -3.535534 -1.836992 -3.163008 -2.5 -2.5 \n",
       "C -3.163008 -1.836992 -3.535534 -0.937635 -3.535534 0 \n",
       "C -3.535534 0.937635 -3.163008 1.836992 -2.5 2.5 \n",
       "C -1.836992 3.163008 -0.937635 3.535534 0 3.535534 \n",
       "z\n",
       "\" id=\"mdf054444e1\" style=\"stroke:#d3d3d3;\"/>\n",
       "    </defs>\n",
       "    <g clip-path=\"url(#p09e02e730b)\">\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"112.344886\" xlink:href=\"#mdf054444e1\" y=\"214.756364\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"112.344886\" xlink:href=\"#mdf054444e1\" y=\"148.865455\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"112.344886\" xlink:href=\"#mdf054444e1\" y=\"82.974545\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"112.344886\" xlink:href=\"#mdf054444e1\" y=\"17.083636\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"178.235795\" xlink:href=\"#mdf054444e1\" y=\"214.756364\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"178.235795\" xlink:href=\"#mdf054444e1\" y=\"148.865455\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"178.235795\" xlink:href=\"#mdf054444e1\" y=\"82.974545\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"178.235795\" xlink:href=\"#mdf054444e1\" y=\"17.083636\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"244.126705\" xlink:href=\"#mdf054444e1\" y=\"214.756364\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"244.126705\" xlink:href=\"#mdf054444e1\" y=\"148.865455\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"244.126705\" xlink:href=\"#mdf054444e1\" y=\"82.974545\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"244.126705\" xlink:href=\"#mdf054444e1\" y=\"17.083636\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"310.017614\" xlink:href=\"#mdf054444e1\" y=\"214.756364\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"310.017614\" xlink:href=\"#mdf054444e1\" y=\"148.865455\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"310.017614\" xlink:href=\"#mdf054444e1\" y=\"82.974545\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"310.017614\" xlink:href=\"#mdf054444e1\" y=\"17.083636\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"PathCollection_2\">\n",
       "    <defs>\n",
       "     <path d=\"M 0 -3.535534 \n",
       "L -0.793777 -1.09254 \n",
       "L -3.362493 -1.09254 \n",
       "L -1.284358 0.417313 \n",
       "L -2.078135 2.860307 \n",
       "L -0 1.350454 \n",
       "L 2.078135 2.860307 \n",
       "L 1.284358 0.417313 \n",
       "L 3.362493 -1.09254 \n",
       "L 0.793777 -1.09254 \n",
       "z\n",
       "\" id=\"m9783217701\" style=\"stroke:#ff0000;\"/>\n",
       "    </defs>\n",
       "    <g clip-path=\"url(#p09e02e730b)\">\n",
       "     <use style=\"fill:#ff0000;stroke:#ff0000;\" x=\"112.344886\" xlink:href=\"#m9783217701\" y=\"214.756364\"/>\n",
       "     <use style=\"fill:#ff0000;stroke:#ff0000;\" x=\"112.344886\" xlink:href=\"#m9783217701\" y=\"148.865455\"/>\n",
       "     <use style=\"fill:#ff0000;stroke:#ff0000;\" x=\"112.344886\" xlink:href=\"#m9783217701\" y=\"82.974545\"/>\n",
       "     <use style=\"fill:#ff0000;stroke:#ff0000;\" x=\"112.344886\" xlink:href=\"#m9783217701\" y=\"17.083636\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"PathCollection_3\">\n",
       "    <defs>\n",
       "     <path d=\"M 0 1.767767 \n",
       "C 0.468817 1.767767 0.918496 1.581504 1.25 1.25 \n",
       "C 1.581504 0.918496 1.767767 0.468817 1.767767 0 \n",
       "C 1.767767 -0.468817 1.581504 -0.918496 1.25 -1.25 \n",
       "C 0.918496 -1.581504 0.468817 -1.767767 0 -1.767767 \n",
       "C -0.468817 -1.767767 -0.918496 -1.581504 -1.25 -1.25 \n",
       "C -1.581504 -0.918496 -1.767767 -0.468817 -1.767767 0 \n",
       "C -1.767767 0.468817 -1.581504 0.918496 -1.25 1.25 \n",
       "C -0.918496 1.581504 -0.468817 1.767767 0 1.767767 \n",
       "z\n",
       "\" id=\"m5a09def213\" style=\"stroke:#0000ff;\"/>\n",
       "    </defs>\n",
       "    <g clip-path=\"url(#p09e02e730b)\">\n",
       "     <use style=\"fill:#0000ff;stroke:#0000ff;\" x=\"112.344886\" xlink:href=\"#m5a09def213\" y=\"17.083636\"/>\n",
       "     <use style=\"fill:#0000ff;stroke:#0000ff;\" x=\"178.235795\" xlink:href=\"#m5a09def213\" y=\"17.083636\"/>\n",
       "     <use style=\"fill:#0000ff;stroke:#0000ff;\" x=\"244.126705\" xlink:href=\"#m5a09def213\" y=\"17.083636\"/>\n",
       "     <use style=\"fill:#0000ff;stroke:#0000ff;\" x=\"310.017614\" xlink:href=\"#m5a09def213\" y=\"17.083636\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"PathCollection_4\">\n",
       "    <defs>\n",
       "     <path d=\"M -3.535534 3.535534 \n",
       "L 3.535534 3.535534 \n",
       "L 3.535534 -3.535534 \n",
       "L -3.535534 -3.535534 \n",
       "z\n",
       "\" id=\"md45ef923c4\" style=\"stroke:#008000;\"/>\n",
       "    </defs>\n",
       "    <g clip-path=\"url(#p09e02e730b)\">\n",
       "     <use style=\"fill:#008000;stroke:#008000;\" x=\"178.235795\" xlink:href=\"#md45ef923c4\" y=\"214.756364\"/>\n",
       "     <use style=\"fill:#008000;stroke:#008000;\" x=\"178.235795\" xlink:href=\"#md45ef923c4\" y=\"148.865455\"/>\n",
       "     <use style=\"fill:#008000;stroke:#008000;\" x=\"178.235795\" xlink:href=\"#md45ef923c4\" y=\"82.974545\"/>\n",
       "     <use style=\"fill:#008000;stroke:#008000;\" x=\"244.126705\" xlink:href=\"#md45ef923c4\" y=\"82.974545\"/>\n",
       "     <use style=\"fill:#008000;stroke:#008000;\" x=\"310.017614\" xlink:href=\"#md45ef923c4\" y=\"82.974545\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L 0 3.5 \n",
       "\" id=\"m922c1fe3dd\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"79.399432\" xlink:href=\"#m922c1fe3dd\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- 0 -->\n",
       "      <g transform=\"translate(76.218182 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2034 4250 \n",
       "Q 1547 4250 1301 3770 \n",
       "Q 1056 3291 1056 2328 \n",
       "Q 1056 1369 1301 889 \n",
       "Q 1547 409 2034 409 \n",
       "Q 2525 409 2770 889 \n",
       "Q 3016 1369 3016 2328 \n",
       "Q 3016 3291 2770 3770 \n",
       "Q 2525 4250 2034 4250 \n",
       "z\n",
       "M 2034 4750 \n",
       "Q 2819 4750 3233 4129 \n",
       "Q 3647 3509 3647 2328 \n",
       "Q 3647 1150 3233 529 \n",
       "Q 2819 -91 2034 -91 \n",
       "Q 1250 -91 836 529 \n",
       "Q 422 1150 422 2328 \n",
       "Q 422 3509 836 4129 \n",
       "Q 1250 4750 2034 4750 \n",
       "z\n",
       "\" id=\"DejaVuSans-30\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_2\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"145.290341\" xlink:href=\"#m922c1fe3dd\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- 1 -->\n",
       "      <g transform=\"translate(142.109091 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 794 531 \n",
       "L 1825 531 \n",
       "L 1825 4091 \n",
       "L 703 3866 \n",
       "L 703 4441 \n",
       "L 1819 4666 \n",
       "L 2450 4666 \n",
       "L 2450 531 \n",
       "L 3481 531 \n",
       "L 3481 0 \n",
       "L 794 0 \n",
       "L 794 531 \n",
       "z\n",
       "\" id=\"DejaVuSans-31\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"211.18125\" xlink:href=\"#m922c1fe3dd\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- 2 -->\n",
       "      <g transform=\"translate(208 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 1228 531 \n",
       "L 3431 531 \n",
       "L 3431 0 \n",
       "L 469 0 \n",
       "L 469 531 \n",
       "Q 828 903 1448 1529 \n",
       "Q 2069 2156 2228 2338 \n",
       "Q 2531 2678 2651 2914 \n",
       "Q 2772 3150 2772 3378 \n",
       "Q 2772 3750 2511 3984 \n",
       "Q 2250 4219 1831 4219 \n",
       "Q 1534 4219 1204 4116 \n",
       "Q 875 4013 500 3803 \n",
       "L 500 4441 \n",
       "Q 881 4594 1212 4672 \n",
       "Q 1544 4750 1819 4750 \n",
       "Q 2544 4750 2975 4387 \n",
       "Q 3406 4025 3406 3419 \n",
       "Q 3406 3131 3298 2873 \n",
       "Q 3191 2616 2906 2266 \n",
       "Q 2828 2175 2409 1742 \n",
       "Q 1991 1309 1228 531 \n",
       "z\n",
       "\" id=\"DejaVuSans-32\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_4\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"277.072159\" xlink:href=\"#m922c1fe3dd\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_4\">\n",
       "      <!-- 3 -->\n",
       "      <g transform=\"translate(273.890909 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2597 2516 \n",
       "Q 3050 2419 3304 2112 \n",
       "Q 3559 1806 3559 1356 \n",
       "Q 3559 666 3084 287 \n",
       "Q 2609 -91 1734 -91 \n",
       "Q 1441 -91 1130 -33 \n",
       "Q 819 25 488 141 \n",
       "L 488 750 \n",
       "Q 750 597 1062 519 \n",
       "Q 1375 441 1716 441 \n",
       "Q 2309 441 2620 675 \n",
       "Q 2931 909 2931 1356 \n",
       "Q 2931 1769 2642 2001 \n",
       "Q 2353 2234 1838 2234 \n",
       "L 1294 2234 \n",
       "L 1294 2753 \n",
       "L 1863 2753 \n",
       "Q 2328 2753 2575 2939 \n",
       "Q 2822 3125 2822 3475 \n",
       "Q 2822 3834 2567 4026 \n",
       "Q 2313 4219 1838 4219 \n",
       "Q 1578 4219 1281 4162 \n",
       "Q 984 4106 628 3988 \n",
       "L 628 4550 \n",
       "Q 988 4650 1302 4700 \n",
       "Q 1616 4750 1894 4750 \n",
       "Q 2613 4750 3031 4423 \n",
       "Q 3450 4097 3450 3541 \n",
       "Q 3450 3153 3228 2886 \n",
       "Q 3006 2619 2597 2516 \n",
       "z\n",
       "\" id=\"DejaVuSans-33\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"342.963068\" xlink:href=\"#m922c1fe3dd\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- 4 -->\n",
       "      <g transform=\"translate(339.781818 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2419 4116 \n",
       "L 825 1625 \n",
       "L 2419 1625 \n",
       "L 2419 4116 \n",
       "z\n",
       "M 2253 4666 \n",
       "L 3047 4666 \n",
       "L 3047 1625 \n",
       "L 3713 1625 \n",
       "L 3713 1100 \n",
       "L 3047 1100 \n",
       "L 3047 0 \n",
       "L 2419 0 \n",
       "L 2419 1100 \n",
       "L 313 1100 \n",
       "L 313 1709 \n",
       "L 2253 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-34\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-34\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_6\">\n",
       "     <!-- X -->\n",
       "     <g transform=\"translate(207.75625 252.916562)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M 403 4666 \n",
       "L 1081 4666 \n",
       "L 2241 2931 \n",
       "L 3406 4666 \n",
       "L 4084 4666 \n",
       "L 2584 2425 \n",
       "L 4184 0 \n",
       "L 3506 0 \n",
       "L 2194 1984 \n",
       "L 872 0 \n",
       "L 191 0 \n",
       "L 1856 2491 \n",
       "L 403 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-58\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-58\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_6\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L -3.5 0 \n",
       "\" id=\"mf7b3de7f48\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#mf7b3de7f48\" y=\"214.756364\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_7\">\n",
       "      <!-- 0.5 -->\n",
       "      <g transform=\"translate(20.878125 218.555582)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 684 794 \n",
       "L 1344 794 \n",
       "L 1344 0 \n",
       "L 684 0 \n",
       "L 684 794 \n",
       "z\n",
       "\" id=\"DejaVuSans-2e\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 691 4666 \n",
       "L 3169 4666 \n",
       "L 3169 4134 \n",
       "L 1269 4134 \n",
       "L 1269 2991 \n",
       "Q 1406 3038 1543 3061 \n",
       "Q 1681 3084 1819 3084 \n",
       "Q 2600 3084 3056 2656 \n",
       "Q 3513 2228 3513 1497 \n",
       "Q 3513 744 3044 326 \n",
       "Q 2575 -91 1722 -91 \n",
       "Q 1428 -91 1123 -41 \n",
       "Q 819 9 494 109 \n",
       "L 494 744 \n",
       "Q 775 591 1075 516 \n",
       "Q 1375 441 1709 441 \n",
       "Q 2250 441 2565 725 \n",
       "Q 2881 1009 2881 1497 \n",
       "Q 2881 1984 2565 2268 \n",
       "Q 2250 2553 1709 2553 \n",
       "Q 1456 2553 1204 2497 \n",
       "Q 953 2441 691 2322 \n",
       "L 691 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-35\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_7\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#mf7b3de7f48\" y=\"181.810909\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_8\">\n",
       "      <!-- 1.0 -->\n",
       "      <g transform=\"translate(20.878125 185.610128)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_8\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#mf7b3de7f48\" y=\"148.865455\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_9\">\n",
       "      <!-- 1.5 -->\n",
       "      <g transform=\"translate(20.878125 152.664673)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_9\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#mf7b3de7f48\" y=\"115.92\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_10\">\n",
       "      <!-- 2.0 -->\n",
       "      <g transform=\"translate(20.878125 119.719219)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_5\">\n",
       "     <g id=\"line2d_10\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#mf7b3de7f48\" y=\"82.974545\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_11\">\n",
       "      <!-- 2.5 -->\n",
       "      <g transform=\"translate(20.878125 86.773764)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_6\">\n",
       "     <g id=\"line2d_11\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#mf7b3de7f48\" y=\"50.029091\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_12\">\n",
       "      <!-- 3.0 -->\n",
       "      <g transform=\"translate(20.878125 53.82831)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_7\">\n",
       "     <g id=\"line2d_12\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#mf7b3de7f48\" y=\"17.083636\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_13\">\n",
       "      <!-- 3.5 -->\n",
       "      <g transform=\"translate(20.878125 20.882855)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_14\">\n",
       "     <!-- Y -->\n",
       "     <g transform=\"translate(14.798438 118.973906)rotate(-90)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M -13 4666 \n",
       "L 666 4666 \n",
       "L 1959 2747 \n",
       "L 3244 4666 \n",
       "L 3922 4666 \n",
       "L 2272 2222 \n",
       "L 2272 0 \n",
       "L 1638 0 \n",
       "L 1638 2222 \n",
       "L -13 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-59\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-59\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path d=\"M 43.78125 224.64 \n",
       "L 43.78125 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path d=\"M 378.58125 224.64 \n",
       "L 378.58125 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path d=\"M 43.78125 224.64 \n",
       "L 378.58125 224.64 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path d=\"M 43.78125 7.2 \n",
       "L 378.58125 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"p09e02e730b\">\n",
       "   <rect height=\"217.44\" width=\"334.8\" x=\"43.78125\" y=\"7.2\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax = plt.subplots()\n",
    "op.topotools.plot_coordinates(pn, pn.Ps, c='lightgrey',\n",
    "                              markersize=50, ax=ax)\n",
    "op.topotools.plot_coordinates(pn, P_left, c='red', \n",
    "                              markersize=50, marker='*', ax=ax)\n",
    "op.topotools.plot_coordinates(pn, P_bottom, c='blue', \n",
    "                              markersize=50, marker='.', ax=ax)\n",
    "op.topotools.plot_coordinates(pn, Ps, c='green', \n",
    "                              markersize=50, marker='s', ax=ax)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Find Non-Shared Neighbors: XOR\n",
    "> *Finds all pores with exactly one connection to the input pores*\n",
    "\n",
    "Given a set of pores find the pores that are neighbors of one and only one of the input pores.  This is called **XOR**, or 'exclusve_or' because it finds the pores that are neigbhors to the 'bottom' *or* the 'left', but *not* both. "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2021-06-24T11:25:20.350462Z",
     "iopub.status.busy": "2021-06-24T11:25:20.348408Z",
     "iopub.status.idle": "2021-06-24T11:25:20.354180Z",
     "shell.execute_reply": "2021-06-24T11:25:20.355321Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[ 0  1  2  3  7 11 15]\n",
      "[ 4  5 10 14]\n"
     ]
    }
   ],
   "source": [
    "Ps = pn.pores(['left', 'back'])\n",
    "print(Ps)\n",
    "Ps = pn.find_neighbor_pores (pores=Ps, mode='xor')\n",
    "print(Ps)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2021-06-24T11:25:20.396590Z",
     "iopub.status.busy": "2021-06-24T11:25:20.392062Z",
     "iopub.status.idle": "2021-06-24T11:25:20.518757Z",
     "shell.execute_reply": "2021-06-24T11:25:20.519936Z"
    }
   },
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<svg height=\"262.19625pt\" version=\"1.1\" viewBox=\"0 0 385.78125 262.19625\" width=\"385.78125pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:date>2021-06-24T07:25:20.480906</dc:date>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Matplotlib v3.4.2, https://matplotlib.org/</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 262.19625 \n",
       "L 385.78125 262.19625 \n",
       "L 385.78125 0 \n",
       "L 0 0 \n",
       "z\n",
       "\" style=\"fill:none;\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 43.78125 224.64 \n",
       "L 378.58125 224.64 \n",
       "L 378.58125 7.2 \n",
       "L 43.78125 7.2 \n",
       "z\n",
       "\" style=\"fill:#ffffff;\"/>\n",
       "   </g>\n",
       "   <g id=\"PathCollection_1\">\n",
       "    <defs>\n",
       "     <path d=\"M 0 3.535534 \n",
       "C 0.937635 3.535534 1.836992 3.163008 2.5 2.5 \n",
       "C 3.163008 1.836992 3.535534 0.937635 3.535534 0 \n",
       "C 3.535534 -0.937635 3.163008 -1.836992 2.5 -2.5 \n",
       "C 1.836992 -3.163008 0.937635 -3.535534 0 -3.535534 \n",
       "C -0.937635 -3.535534 -1.836992 -3.163008 -2.5 -2.5 \n",
       "C -3.163008 -1.836992 -3.535534 -0.937635 -3.535534 0 \n",
       "C -3.535534 0.937635 -3.163008 1.836992 -2.5 2.5 \n",
       "C -1.836992 3.163008 -0.937635 3.535534 0 3.535534 \n",
       "z\n",
       "\" id=\"me211bae192\" style=\"stroke:#d3d3d3;\"/>\n",
       "    </defs>\n",
       "    <g clip-path=\"url(#pb55d508258)\">\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"112.344886\" xlink:href=\"#me211bae192\" y=\"214.756364\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"112.344886\" xlink:href=\"#me211bae192\" y=\"148.865455\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"112.344886\" xlink:href=\"#me211bae192\" y=\"82.974545\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"112.344886\" xlink:href=\"#me211bae192\" y=\"17.083636\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"178.235795\" xlink:href=\"#me211bae192\" y=\"214.756364\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"178.235795\" xlink:href=\"#me211bae192\" y=\"148.865455\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"178.235795\" xlink:href=\"#me211bae192\" y=\"82.974545\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"178.235795\" xlink:href=\"#me211bae192\" y=\"17.083636\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"244.126705\" xlink:href=\"#me211bae192\" y=\"214.756364\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"244.126705\" xlink:href=\"#me211bae192\" y=\"148.865455\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"244.126705\" xlink:href=\"#me211bae192\" y=\"82.974545\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"244.126705\" xlink:href=\"#me211bae192\" y=\"17.083636\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"310.017614\" xlink:href=\"#me211bae192\" y=\"214.756364\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"310.017614\" xlink:href=\"#me211bae192\" y=\"148.865455\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"310.017614\" xlink:href=\"#me211bae192\" y=\"82.974545\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"310.017614\" xlink:href=\"#me211bae192\" y=\"17.083636\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"PathCollection_2\">\n",
       "    <defs>\n",
       "     <path d=\"M 0 -3.535534 \n",
       "L -0.793777 -1.09254 \n",
       "L -3.362493 -1.09254 \n",
       "L -1.284358 0.417313 \n",
       "L -2.078135 2.860307 \n",
       "L -0 1.350454 \n",
       "L 2.078135 2.860307 \n",
       "L 1.284358 0.417313 \n",
       "L 3.362493 -1.09254 \n",
       "L 0.793777 -1.09254 \n",
       "z\n",
       "\" id=\"m0636f73cdc\" style=\"stroke:#ff0000;\"/>\n",
       "    </defs>\n",
       "    <g clip-path=\"url(#pb55d508258)\">\n",
       "     <use style=\"fill:#ff0000;stroke:#ff0000;\" x=\"112.344886\" xlink:href=\"#m0636f73cdc\" y=\"214.756364\"/>\n",
       "     <use style=\"fill:#ff0000;stroke:#ff0000;\" x=\"112.344886\" xlink:href=\"#m0636f73cdc\" y=\"148.865455\"/>\n",
       "     <use style=\"fill:#ff0000;stroke:#ff0000;\" x=\"112.344886\" xlink:href=\"#m0636f73cdc\" y=\"82.974545\"/>\n",
       "     <use style=\"fill:#ff0000;stroke:#ff0000;\" x=\"112.344886\" xlink:href=\"#m0636f73cdc\" y=\"17.083636\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"PathCollection_3\">\n",
       "    <defs>\n",
       "     <path d=\"M 0 1.767767 \n",
       "C 0.468817 1.767767 0.918496 1.581504 1.25 1.25 \n",
       "C 1.581504 0.918496 1.767767 0.468817 1.767767 0 \n",
       "C 1.767767 -0.468817 1.581504 -0.918496 1.25 -1.25 \n",
       "C 0.918496 -1.581504 0.468817 -1.767767 0 -1.767767 \n",
       "C -0.468817 -1.767767 -0.918496 -1.581504 -1.25 -1.25 \n",
       "C -1.581504 -0.918496 -1.767767 -0.468817 -1.767767 0 \n",
       "C -1.767767 0.468817 -1.581504 0.918496 -1.25 1.25 \n",
       "C -0.918496 1.581504 -0.468817 1.767767 0 1.767767 \n",
       "z\n",
       "\" id=\"m83ceb52aa2\" style=\"stroke:#0000ff;\"/>\n",
       "    </defs>\n",
       "    <g clip-path=\"url(#pb55d508258)\">\n",
       "     <use style=\"fill:#0000ff;stroke:#0000ff;\" x=\"112.344886\" xlink:href=\"#m83ceb52aa2\" y=\"17.083636\"/>\n",
       "     <use style=\"fill:#0000ff;stroke:#0000ff;\" x=\"178.235795\" xlink:href=\"#m83ceb52aa2\" y=\"17.083636\"/>\n",
       "     <use style=\"fill:#0000ff;stroke:#0000ff;\" x=\"244.126705\" xlink:href=\"#m83ceb52aa2\" y=\"17.083636\"/>\n",
       "     <use style=\"fill:#0000ff;stroke:#0000ff;\" x=\"310.017614\" xlink:href=\"#m83ceb52aa2\" y=\"17.083636\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"PathCollection_4\">\n",
       "    <defs>\n",
       "     <path d=\"M -3.535534 3.535534 \n",
       "L 3.535534 3.535534 \n",
       "L 3.535534 -3.535534 \n",
       "L -3.535534 -3.535534 \n",
       "z\n",
       "\" id=\"mf2a1a00411\" style=\"stroke:#008000;\"/>\n",
       "    </defs>\n",
       "    <g clip-path=\"url(#pb55d508258)\">\n",
       "     <use style=\"fill:#008000;stroke:#008000;\" x=\"178.235795\" xlink:href=\"#mf2a1a00411\" y=\"214.756364\"/>\n",
       "     <use style=\"fill:#008000;stroke:#008000;\" x=\"178.235795\" xlink:href=\"#mf2a1a00411\" y=\"148.865455\"/>\n",
       "     <use style=\"fill:#008000;stroke:#008000;\" x=\"244.126705\" xlink:href=\"#mf2a1a00411\" y=\"82.974545\"/>\n",
       "     <use style=\"fill:#008000;stroke:#008000;\" x=\"310.017614\" xlink:href=\"#mf2a1a00411\" y=\"82.974545\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L 0 3.5 \n",
       "\" id=\"m168d78d3f7\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"79.399432\" xlink:href=\"#m168d78d3f7\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- 0 -->\n",
       "      <g transform=\"translate(76.218182 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2034 4250 \n",
       "Q 1547 4250 1301 3770 \n",
       "Q 1056 3291 1056 2328 \n",
       "Q 1056 1369 1301 889 \n",
       "Q 1547 409 2034 409 \n",
       "Q 2525 409 2770 889 \n",
       "Q 3016 1369 3016 2328 \n",
       "Q 3016 3291 2770 3770 \n",
       "Q 2525 4250 2034 4250 \n",
       "z\n",
       "M 2034 4750 \n",
       "Q 2819 4750 3233 4129 \n",
       "Q 3647 3509 3647 2328 \n",
       "Q 3647 1150 3233 529 \n",
       "Q 2819 -91 2034 -91 \n",
       "Q 1250 -91 836 529 \n",
       "Q 422 1150 422 2328 \n",
       "Q 422 3509 836 4129 \n",
       "Q 1250 4750 2034 4750 \n",
       "z\n",
       "\" id=\"DejaVuSans-30\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_2\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"145.290341\" xlink:href=\"#m168d78d3f7\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- 1 -->\n",
       "      <g transform=\"translate(142.109091 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 794 531 \n",
       "L 1825 531 \n",
       "L 1825 4091 \n",
       "L 703 3866 \n",
       "L 703 4441 \n",
       "L 1819 4666 \n",
       "L 2450 4666 \n",
       "L 2450 531 \n",
       "L 3481 531 \n",
       "L 3481 0 \n",
       "L 794 0 \n",
       "L 794 531 \n",
       "z\n",
       "\" id=\"DejaVuSans-31\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"211.18125\" xlink:href=\"#m168d78d3f7\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- 2 -->\n",
       "      <g transform=\"translate(208 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 1228 531 \n",
       "L 3431 531 \n",
       "L 3431 0 \n",
       "L 469 0 \n",
       "L 469 531 \n",
       "Q 828 903 1448 1529 \n",
       "Q 2069 2156 2228 2338 \n",
       "Q 2531 2678 2651 2914 \n",
       "Q 2772 3150 2772 3378 \n",
       "Q 2772 3750 2511 3984 \n",
       "Q 2250 4219 1831 4219 \n",
       "Q 1534 4219 1204 4116 \n",
       "Q 875 4013 500 3803 \n",
       "L 500 4441 \n",
       "Q 881 4594 1212 4672 \n",
       "Q 1544 4750 1819 4750 \n",
       "Q 2544 4750 2975 4387 \n",
       "Q 3406 4025 3406 3419 \n",
       "Q 3406 3131 3298 2873 \n",
       "Q 3191 2616 2906 2266 \n",
       "Q 2828 2175 2409 1742 \n",
       "Q 1991 1309 1228 531 \n",
       "z\n",
       "\" id=\"DejaVuSans-32\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_4\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"277.072159\" xlink:href=\"#m168d78d3f7\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_4\">\n",
       "      <!-- 3 -->\n",
       "      <g transform=\"translate(273.890909 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2597 2516 \n",
       "Q 3050 2419 3304 2112 \n",
       "Q 3559 1806 3559 1356 \n",
       "Q 3559 666 3084 287 \n",
       "Q 2609 -91 1734 -91 \n",
       "Q 1441 -91 1130 -33 \n",
       "Q 819 25 488 141 \n",
       "L 488 750 \n",
       "Q 750 597 1062 519 \n",
       "Q 1375 441 1716 441 \n",
       "Q 2309 441 2620 675 \n",
       "Q 2931 909 2931 1356 \n",
       "Q 2931 1769 2642 2001 \n",
       "Q 2353 2234 1838 2234 \n",
       "L 1294 2234 \n",
       "L 1294 2753 \n",
       "L 1863 2753 \n",
       "Q 2328 2753 2575 2939 \n",
       "Q 2822 3125 2822 3475 \n",
       "Q 2822 3834 2567 4026 \n",
       "Q 2313 4219 1838 4219 \n",
       "Q 1578 4219 1281 4162 \n",
       "Q 984 4106 628 3988 \n",
       "L 628 4550 \n",
       "Q 988 4650 1302 4700 \n",
       "Q 1616 4750 1894 4750 \n",
       "Q 2613 4750 3031 4423 \n",
       "Q 3450 4097 3450 3541 \n",
       "Q 3450 3153 3228 2886 \n",
       "Q 3006 2619 2597 2516 \n",
       "z\n",
       "\" id=\"DejaVuSans-33\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"342.963068\" xlink:href=\"#m168d78d3f7\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- 4 -->\n",
       "      <g transform=\"translate(339.781818 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2419 4116 \n",
       "L 825 1625 \n",
       "L 2419 1625 \n",
       "L 2419 4116 \n",
       "z\n",
       "M 2253 4666 \n",
       "L 3047 4666 \n",
       "L 3047 1625 \n",
       "L 3713 1625 \n",
       "L 3713 1100 \n",
       "L 3047 1100 \n",
       "L 3047 0 \n",
       "L 2419 0 \n",
       "L 2419 1100 \n",
       "L 313 1100 \n",
       "L 313 1709 \n",
       "L 2253 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-34\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-34\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_6\">\n",
       "     <!-- X -->\n",
       "     <g transform=\"translate(207.75625 252.916562)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M 403 4666 \n",
       "L 1081 4666 \n",
       "L 2241 2931 \n",
       "L 3406 4666 \n",
       "L 4084 4666 \n",
       "L 2584 2425 \n",
       "L 4184 0 \n",
       "L 3506 0 \n",
       "L 2194 1984 \n",
       "L 872 0 \n",
       "L 191 0 \n",
       "L 1856 2491 \n",
       "L 403 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-58\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-58\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_6\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L -3.5 0 \n",
       "\" id=\"m1af91a8523\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#m1af91a8523\" y=\"214.756364\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_7\">\n",
       "      <!-- 0.5 -->\n",
       "      <g transform=\"translate(20.878125 218.555582)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 684 794 \n",
       "L 1344 794 \n",
       "L 1344 0 \n",
       "L 684 0 \n",
       "L 684 794 \n",
       "z\n",
       "\" id=\"DejaVuSans-2e\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 691 4666 \n",
       "L 3169 4666 \n",
       "L 3169 4134 \n",
       "L 1269 4134 \n",
       "L 1269 2991 \n",
       "Q 1406 3038 1543 3061 \n",
       "Q 1681 3084 1819 3084 \n",
       "Q 2600 3084 3056 2656 \n",
       "Q 3513 2228 3513 1497 \n",
       "Q 3513 744 3044 326 \n",
       "Q 2575 -91 1722 -91 \n",
       "Q 1428 -91 1123 -41 \n",
       "Q 819 9 494 109 \n",
       "L 494 744 \n",
       "Q 775 591 1075 516 \n",
       "Q 1375 441 1709 441 \n",
       "Q 2250 441 2565 725 \n",
       "Q 2881 1009 2881 1497 \n",
       "Q 2881 1984 2565 2268 \n",
       "Q 2250 2553 1709 2553 \n",
       "Q 1456 2553 1204 2497 \n",
       "Q 953 2441 691 2322 \n",
       "L 691 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-35\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_7\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#m1af91a8523\" y=\"181.810909\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_8\">\n",
       "      <!-- 1.0 -->\n",
       "      <g transform=\"translate(20.878125 185.610128)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_8\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#m1af91a8523\" y=\"148.865455\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_9\">\n",
       "      <!-- 1.5 -->\n",
       "      <g transform=\"translate(20.878125 152.664673)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_9\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#m1af91a8523\" y=\"115.92\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_10\">\n",
       "      <!-- 2.0 -->\n",
       "      <g transform=\"translate(20.878125 119.719219)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_5\">\n",
       "     <g id=\"line2d_10\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#m1af91a8523\" y=\"82.974545\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_11\">\n",
       "      <!-- 2.5 -->\n",
       "      <g transform=\"translate(20.878125 86.773764)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_6\">\n",
       "     <g id=\"line2d_11\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#m1af91a8523\" y=\"50.029091\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_12\">\n",
       "      <!-- 3.0 -->\n",
       "      <g transform=\"translate(20.878125 53.82831)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_7\">\n",
       "     <g id=\"line2d_12\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#m1af91a8523\" y=\"17.083636\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_13\">\n",
       "      <!-- 3.5 -->\n",
       "      <g transform=\"translate(20.878125 20.882855)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_14\">\n",
       "     <!-- Y -->\n",
       "     <g transform=\"translate(14.798438 118.973906)rotate(-90)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M -13 4666 \n",
       "L 666 4666 \n",
       "L 1959 2747 \n",
       "L 3244 4666 \n",
       "L 3922 4666 \n",
       "L 2272 2222 \n",
       "L 2272 0 \n",
       "L 1638 0 \n",
       "L 1638 2222 \n",
       "L -13 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-59\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-59\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path d=\"M 43.78125 224.64 \n",
       "L 43.78125 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path d=\"M 378.58125 224.64 \n",
       "L 378.58125 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path d=\"M 43.78125 224.64 \n",
       "L 378.58125 224.64 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path d=\"M 43.78125 7.2 \n",
       "L 378.58125 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"pb55d508258\">\n",
       "   <rect height=\"217.44\" width=\"334.8\" x=\"43.78125\" y=\"7.2\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax = plt.subplots()\n",
    "op.topotools.plot_coordinates(pn, pn.Ps, c='lightgrey',\n",
    "                              markersize=50, ax=ax)\n",
    "op.topotools.plot_coordinates(pn, P_left, c='red', \n",
    "                              markersize=50, marker='*', ax=ax)\n",
    "op.topotools.plot_coordinates(pn, P_bottom, c='blue', \n",
    "                              markersize=50, marker='.', ax=ax)\n",
    "op.topotools.plot_coordinates(pn, Ps, c='green', \n",
    "                              markersize=50, marker='s', ax=ax)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Find Common Neighbors of Two Sets: XNOR\n",
    "\n",
    "> *Finds all the pores with 2 or more connections to the input pores*\n",
    "\n",
    "This finds pores that are common to both 'left' and 'bottom' pores.  It is called **XNOR** since it is the opposite of **XOR** , incidated by the *N for not* .   Note that **XNOR** and **NXOR** are interchangable."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2021-06-24T11:25:20.529895Z",
     "iopub.status.busy": "2021-06-24T11:25:20.527764Z",
     "iopub.status.idle": "2021-06-24T11:25:20.535148Z",
     "shell.execute_reply": "2021-06-24T11:25:20.533893Z"
    }
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[ 0  1  2  3  7 11 15]\n",
      "[6]\n"
     ]
    }
   ],
   "source": [
    "Ps = pn.pores(['left', 'back'])\n",
    "print(Ps)\n",
    "Ps = pn.find_neighbor_pores(pores=Ps, mode='xnor')\n",
    "print(Ps)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2021-06-24T11:25:20.580869Z",
     "iopub.status.busy": "2021-06-24T11:25:20.578107Z",
     "iopub.status.idle": "2021-06-24T11:25:20.690630Z",
     "shell.execute_reply": "2021-06-24T11:25:20.691827Z"
    }
   },
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<svg height=\"262.19625pt\" version=\"1.1\" viewBox=\"0 0 385.78125 262.19625\" width=\"385.78125pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:date>2021-06-24T07:25:20.653658</dc:date>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Matplotlib v3.4.2, https://matplotlib.org/</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 262.19625 \n",
       "L 385.78125 262.19625 \n",
       "L 385.78125 0 \n",
       "L 0 0 \n",
       "z\n",
       "\" style=\"fill:none;\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 43.78125 224.64 \n",
       "L 378.58125 224.64 \n",
       "L 378.58125 7.2 \n",
       "L 43.78125 7.2 \n",
       "z\n",
       "\" style=\"fill:#ffffff;\"/>\n",
       "   </g>\n",
       "   <g id=\"PathCollection_1\">\n",
       "    <defs>\n",
       "     <path d=\"M 0 3.535534 \n",
       "C 0.937635 3.535534 1.836992 3.163008 2.5 2.5 \n",
       "C 3.163008 1.836992 3.535534 0.937635 3.535534 0 \n",
       "C 3.535534 -0.937635 3.163008 -1.836992 2.5 -2.5 \n",
       "C 1.836992 -3.163008 0.937635 -3.535534 0 -3.535534 \n",
       "C -0.937635 -3.535534 -1.836992 -3.163008 -2.5 -2.5 \n",
       "C -3.163008 -1.836992 -3.535534 -0.937635 -3.535534 0 \n",
       "C -3.535534 0.937635 -3.163008 1.836992 -2.5 2.5 \n",
       "C -1.836992 3.163008 -0.937635 3.535534 0 3.535534 \n",
       "z\n",
       "\" id=\"m6feb0d17ff\" style=\"stroke:#d3d3d3;\"/>\n",
       "    </defs>\n",
       "    <g clip-path=\"url(#p0755fdf164)\">\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"112.344886\" xlink:href=\"#m6feb0d17ff\" y=\"214.756364\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"112.344886\" xlink:href=\"#m6feb0d17ff\" y=\"148.865455\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"112.344886\" xlink:href=\"#m6feb0d17ff\" y=\"82.974545\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"112.344886\" xlink:href=\"#m6feb0d17ff\" y=\"17.083636\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"178.235795\" xlink:href=\"#m6feb0d17ff\" y=\"214.756364\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"178.235795\" xlink:href=\"#m6feb0d17ff\" y=\"148.865455\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"178.235795\" xlink:href=\"#m6feb0d17ff\" y=\"82.974545\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"178.235795\" xlink:href=\"#m6feb0d17ff\" y=\"17.083636\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"244.126705\" xlink:href=\"#m6feb0d17ff\" y=\"214.756364\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"244.126705\" xlink:href=\"#m6feb0d17ff\" y=\"148.865455\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"244.126705\" xlink:href=\"#m6feb0d17ff\" y=\"82.974545\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"244.126705\" xlink:href=\"#m6feb0d17ff\" y=\"17.083636\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"310.017614\" xlink:href=\"#m6feb0d17ff\" y=\"214.756364\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"310.017614\" xlink:href=\"#m6feb0d17ff\" y=\"148.865455\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"310.017614\" xlink:href=\"#m6feb0d17ff\" y=\"82.974545\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"310.017614\" xlink:href=\"#m6feb0d17ff\" y=\"17.083636\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"PathCollection_2\">\n",
       "    <defs>\n",
       "     <path d=\"M 0 -3.535534 \n",
       "L -0.793777 -1.09254 \n",
       "L -3.362493 -1.09254 \n",
       "L -1.284358 0.417313 \n",
       "L -2.078135 2.860307 \n",
       "L -0 1.350454 \n",
       "L 2.078135 2.860307 \n",
       "L 1.284358 0.417313 \n",
       "L 3.362493 -1.09254 \n",
       "L 0.793777 -1.09254 \n",
       "z\n",
       "\" id=\"md045e14ed4\" style=\"stroke:#ff0000;\"/>\n",
       "    </defs>\n",
       "    <g clip-path=\"url(#p0755fdf164)\">\n",
       "     <use style=\"fill:#ff0000;stroke:#ff0000;\" x=\"112.344886\" xlink:href=\"#md045e14ed4\" y=\"214.756364\"/>\n",
       "     <use style=\"fill:#ff0000;stroke:#ff0000;\" x=\"112.344886\" xlink:href=\"#md045e14ed4\" y=\"148.865455\"/>\n",
       "     <use style=\"fill:#ff0000;stroke:#ff0000;\" x=\"112.344886\" xlink:href=\"#md045e14ed4\" y=\"82.974545\"/>\n",
       "     <use style=\"fill:#ff0000;stroke:#ff0000;\" x=\"112.344886\" xlink:href=\"#md045e14ed4\" y=\"17.083636\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"PathCollection_3\">\n",
       "    <defs>\n",
       "     <path d=\"M 0 1.767767 \n",
       "C 0.468817 1.767767 0.918496 1.581504 1.25 1.25 \n",
       "C 1.581504 0.918496 1.767767 0.468817 1.767767 0 \n",
       "C 1.767767 -0.468817 1.581504 -0.918496 1.25 -1.25 \n",
       "C 0.918496 -1.581504 0.468817 -1.767767 0 -1.767767 \n",
       "C -0.468817 -1.767767 -0.918496 -1.581504 -1.25 -1.25 \n",
       "C -1.581504 -0.918496 -1.767767 -0.468817 -1.767767 0 \n",
       "C -1.767767 0.468817 -1.581504 0.918496 -1.25 1.25 \n",
       "C -0.918496 1.581504 -0.468817 1.767767 0 1.767767 \n",
       "z\n",
       "\" id=\"mff327d39ad\" style=\"stroke:#0000ff;\"/>\n",
       "    </defs>\n",
       "    <g clip-path=\"url(#p0755fdf164)\">\n",
       "     <use style=\"fill:#0000ff;stroke:#0000ff;\" x=\"112.344886\" xlink:href=\"#mff327d39ad\" y=\"17.083636\"/>\n",
       "     <use style=\"fill:#0000ff;stroke:#0000ff;\" x=\"178.235795\" xlink:href=\"#mff327d39ad\" y=\"17.083636\"/>\n",
       "     <use style=\"fill:#0000ff;stroke:#0000ff;\" x=\"244.126705\" xlink:href=\"#mff327d39ad\" y=\"17.083636\"/>\n",
       "     <use style=\"fill:#0000ff;stroke:#0000ff;\" x=\"310.017614\" xlink:href=\"#mff327d39ad\" y=\"17.083636\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"PathCollection_4\">\n",
       "    <defs>\n",
       "     <path d=\"M -3.535534 3.535534 \n",
       "L 3.535534 3.535534 \n",
       "L 3.535534 -3.535534 \n",
       "L -3.535534 -3.535534 \n",
       "z\n",
       "\" id=\"m62515d122a\" style=\"stroke:#008000;\"/>\n",
       "    </defs>\n",
       "    <g clip-path=\"url(#p0755fdf164)\">\n",
       "     <use style=\"fill:#008000;stroke:#008000;\" x=\"178.235795\" xlink:href=\"#m62515d122a\" y=\"82.974545\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L 0 3.5 \n",
       "\" id=\"m6b285dd737\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"79.399432\" xlink:href=\"#m6b285dd737\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- 0 -->\n",
       "      <g transform=\"translate(76.218182 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2034 4250 \n",
       "Q 1547 4250 1301 3770 \n",
       "Q 1056 3291 1056 2328 \n",
       "Q 1056 1369 1301 889 \n",
       "Q 1547 409 2034 409 \n",
       "Q 2525 409 2770 889 \n",
       "Q 3016 1369 3016 2328 \n",
       "Q 3016 3291 2770 3770 \n",
       "Q 2525 4250 2034 4250 \n",
       "z\n",
       "M 2034 4750 \n",
       "Q 2819 4750 3233 4129 \n",
       "Q 3647 3509 3647 2328 \n",
       "Q 3647 1150 3233 529 \n",
       "Q 2819 -91 2034 -91 \n",
       "Q 1250 -91 836 529 \n",
       "Q 422 1150 422 2328 \n",
       "Q 422 3509 836 4129 \n",
       "Q 1250 4750 2034 4750 \n",
       "z\n",
       "\" id=\"DejaVuSans-30\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_2\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"145.290341\" xlink:href=\"#m6b285dd737\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- 1 -->\n",
       "      <g transform=\"translate(142.109091 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 794 531 \n",
       "L 1825 531 \n",
       "L 1825 4091 \n",
       "L 703 3866 \n",
       "L 703 4441 \n",
       "L 1819 4666 \n",
       "L 2450 4666 \n",
       "L 2450 531 \n",
       "L 3481 531 \n",
       "L 3481 0 \n",
       "L 794 0 \n",
       "L 794 531 \n",
       "z\n",
       "\" id=\"DejaVuSans-31\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"211.18125\" xlink:href=\"#m6b285dd737\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- 2 -->\n",
       "      <g transform=\"translate(208 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 1228 531 \n",
       "L 3431 531 \n",
       "L 3431 0 \n",
       "L 469 0 \n",
       "L 469 531 \n",
       "Q 828 903 1448 1529 \n",
       "Q 2069 2156 2228 2338 \n",
       "Q 2531 2678 2651 2914 \n",
       "Q 2772 3150 2772 3378 \n",
       "Q 2772 3750 2511 3984 \n",
       "Q 2250 4219 1831 4219 \n",
       "Q 1534 4219 1204 4116 \n",
       "Q 875 4013 500 3803 \n",
       "L 500 4441 \n",
       "Q 881 4594 1212 4672 \n",
       "Q 1544 4750 1819 4750 \n",
       "Q 2544 4750 2975 4387 \n",
       "Q 3406 4025 3406 3419 \n",
       "Q 3406 3131 3298 2873 \n",
       "Q 3191 2616 2906 2266 \n",
       "Q 2828 2175 2409 1742 \n",
       "Q 1991 1309 1228 531 \n",
       "z\n",
       "\" id=\"DejaVuSans-32\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_4\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"277.072159\" xlink:href=\"#m6b285dd737\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_4\">\n",
       "      <!-- 3 -->\n",
       "      <g transform=\"translate(273.890909 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2597 2516 \n",
       "Q 3050 2419 3304 2112 \n",
       "Q 3559 1806 3559 1356 \n",
       "Q 3559 666 3084 287 \n",
       "Q 2609 -91 1734 -91 \n",
       "Q 1441 -91 1130 -33 \n",
       "Q 819 25 488 141 \n",
       "L 488 750 \n",
       "Q 750 597 1062 519 \n",
       "Q 1375 441 1716 441 \n",
       "Q 2309 441 2620 675 \n",
       "Q 2931 909 2931 1356 \n",
       "Q 2931 1769 2642 2001 \n",
       "Q 2353 2234 1838 2234 \n",
       "L 1294 2234 \n",
       "L 1294 2753 \n",
       "L 1863 2753 \n",
       "Q 2328 2753 2575 2939 \n",
       "Q 2822 3125 2822 3475 \n",
       "Q 2822 3834 2567 4026 \n",
       "Q 2313 4219 1838 4219 \n",
       "Q 1578 4219 1281 4162 \n",
       "Q 984 4106 628 3988 \n",
       "L 628 4550 \n",
       "Q 988 4650 1302 4700 \n",
       "Q 1616 4750 1894 4750 \n",
       "Q 2613 4750 3031 4423 \n",
       "Q 3450 4097 3450 3541 \n",
       "Q 3450 3153 3228 2886 \n",
       "Q 3006 2619 2597 2516 \n",
       "z\n",
       "\" id=\"DejaVuSans-33\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"342.963068\" xlink:href=\"#m6b285dd737\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- 4 -->\n",
       "      <g transform=\"translate(339.781818 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2419 4116 \n",
       "L 825 1625 \n",
       "L 2419 1625 \n",
       "L 2419 4116 \n",
       "z\n",
       "M 2253 4666 \n",
       "L 3047 4666 \n",
       "L 3047 1625 \n",
       "L 3713 1625 \n",
       "L 3713 1100 \n",
       "L 3047 1100 \n",
       "L 3047 0 \n",
       "L 2419 0 \n",
       "L 2419 1100 \n",
       "L 313 1100 \n",
       "L 313 1709 \n",
       "L 2253 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-34\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-34\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_6\">\n",
       "     <!-- X -->\n",
       "     <g transform=\"translate(207.75625 252.916562)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M 403 4666 \n",
       "L 1081 4666 \n",
       "L 2241 2931 \n",
       "L 3406 4666 \n",
       "L 4084 4666 \n",
       "L 2584 2425 \n",
       "L 4184 0 \n",
       "L 3506 0 \n",
       "L 2194 1984 \n",
       "L 872 0 \n",
       "L 191 0 \n",
       "L 1856 2491 \n",
       "L 403 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-58\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-58\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_6\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L -3.5 0 \n",
       "\" id=\"m114835e349\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#m114835e349\" y=\"214.756364\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_7\">\n",
       "      <!-- 0.5 -->\n",
       "      <g transform=\"translate(20.878125 218.555582)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 684 794 \n",
       "L 1344 794 \n",
       "L 1344 0 \n",
       "L 684 0 \n",
       "L 684 794 \n",
       "z\n",
       "\" id=\"DejaVuSans-2e\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 691 4666 \n",
       "L 3169 4666 \n",
       "L 3169 4134 \n",
       "L 1269 4134 \n",
       "L 1269 2991 \n",
       "Q 1406 3038 1543 3061 \n",
       "Q 1681 3084 1819 3084 \n",
       "Q 2600 3084 3056 2656 \n",
       "Q 3513 2228 3513 1497 \n",
       "Q 3513 744 3044 326 \n",
       "Q 2575 -91 1722 -91 \n",
       "Q 1428 -91 1123 -41 \n",
       "Q 819 9 494 109 \n",
       "L 494 744 \n",
       "Q 775 591 1075 516 \n",
       "Q 1375 441 1709 441 \n",
       "Q 2250 441 2565 725 \n",
       "Q 2881 1009 2881 1497 \n",
       "Q 2881 1984 2565 2268 \n",
       "Q 2250 2553 1709 2553 \n",
       "Q 1456 2553 1204 2497 \n",
       "Q 953 2441 691 2322 \n",
       "L 691 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-35\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_7\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#m114835e349\" y=\"181.810909\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_8\">\n",
       "      <!-- 1.0 -->\n",
       "      <g transform=\"translate(20.878125 185.610128)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_8\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#m114835e349\" y=\"148.865455\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_9\">\n",
       "      <!-- 1.5 -->\n",
       "      <g transform=\"translate(20.878125 152.664673)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_9\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#m114835e349\" y=\"115.92\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_10\">\n",
       "      <!-- 2.0 -->\n",
       "      <g transform=\"translate(20.878125 119.719219)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_5\">\n",
       "     <g id=\"line2d_10\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#m114835e349\" y=\"82.974545\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_11\">\n",
       "      <!-- 2.5 -->\n",
       "      <g transform=\"translate(20.878125 86.773764)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_6\">\n",
       "     <g id=\"line2d_11\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#m114835e349\" y=\"50.029091\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_12\">\n",
       "      <!-- 3.0 -->\n",
       "      <g transform=\"translate(20.878125 53.82831)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_7\">\n",
       "     <g id=\"line2d_12\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#m114835e349\" y=\"17.083636\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_13\">\n",
       "      <!-- 3.5 -->\n",
       "      <g transform=\"translate(20.878125 20.882855)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_14\">\n",
       "     <!-- Y -->\n",
       "     <g transform=\"translate(14.798438 118.973906)rotate(-90)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M -13 4666 \n",
       "L 666 4666 \n",
       "L 1959 2747 \n",
       "L 3244 4666 \n",
       "L 3922 4666 \n",
       "L 2272 2222 \n",
       "L 2272 0 \n",
       "L 1638 0 \n",
       "L 1638 2222 \n",
       "L -13 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-59\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-59\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path d=\"M 43.78125 224.64 \n",
       "L 43.78125 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path d=\"M 378.58125 224.64 \n",
       "L 378.58125 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path d=\"M 43.78125 224.64 \n",
       "L 378.58125 224.64 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path d=\"M 43.78125 7.2 \n",
       "L 378.58125 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"p0755fdf164\">\n",
       "   <rect height=\"217.44\" width=\"334.8\" x=\"43.78125\" y=\"7.2\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax = plt.subplots()\n",
    "op.topotools.plot_coordinates(pn, pn.Ps, c='lightgrey', \n",
    "                              markersize=50, ax=ax)\n",
    "op.topotools.plot_coordinates(pn, P_left, c='red', \n",
    "                              markersize=50, marker='*', ax=ax)\n",
    "op.topotools.plot_coordinates(pn, P_bottom, c='blue', \n",
    "                              markersize=50, marker='.', ax=ax)\n",
    "op.topotools.plot_coordinates(pn, Ps, c='green', \n",
    "                              markersize=50, marker='s', ax=ax)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## Find Neighboring Throats\n",
    "Neighbor throat queries follow essentially the same logic as the neighboring queries outlined above.  "
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Find All Neighboring Throats: OR\n",
    "> *Finds all throats connected to any of the input pores*\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2021-06-24T11:25:20.700548Z",
     "iopub.status.busy": "2021-06-24T11:25:20.698757Z",
     "iopub.status.idle": "2021-06-24T11:25:20.701938Z",
     "shell.execute_reply": "2021-06-24T11:25:20.702943Z"
    }
   },
   "outputs": [],
   "source": [
    "Ps = pn.pores(['left', 'back'])\n",
    "Ts = pn.find_neighbor_throats(pores=Ps, mode='or')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2021-06-24T11:25:20.740580Z",
     "iopub.status.busy": "2021-06-24T11:25:20.735630Z",
     "iopub.status.idle": "2021-06-24T11:25:20.856913Z",
     "shell.execute_reply": "2021-06-24T11:25:20.858069Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x1c2012028b0>"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<svg height=\"262.19625pt\" version=\"1.1\" viewBox=\"0 0 385.78125 262.19625\" width=\"385.78125pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:date>2021-06-24T07:25:20.819976</dc:date>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Matplotlib v3.4.2, https://matplotlib.org/</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 262.19625 \n",
       "L 385.78125 262.19625 \n",
       "L 385.78125 0 \n",
       "L 0 0 \n",
       "z\n",
       "\" style=\"fill:none;\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 43.78125 224.64 \n",
       "L 378.58125 224.64 \n",
       "L 378.58125 7.2 \n",
       "L 43.78125 7.2 \n",
       "z\n",
       "\" style=\"fill:#ffffff;\"/>\n",
       "   </g>\n",
       "   <g id=\"PathCollection_1\">\n",
       "    <defs>\n",
       "     <path d=\"M 0 3.535534 \n",
       "C 0.937635 3.535534 1.836992 3.163008 2.5 2.5 \n",
       "C 3.163008 1.836992 3.535534 0.937635 3.535534 0 \n",
       "C 3.535534 -0.937635 3.163008 -1.836992 2.5 -2.5 \n",
       "C 1.836992 -3.163008 0.937635 -3.535534 0 -3.535534 \n",
       "C -0.937635 -3.535534 -1.836992 -3.163008 -2.5 -2.5 \n",
       "C -3.163008 -1.836992 -3.535534 -0.937635 -3.535534 0 \n",
       "C -3.535534 0.937635 -3.163008 1.836992 -2.5 2.5 \n",
       "C -1.836992 3.163008 -0.937635 3.535534 0 3.535534 \n",
       "z\n",
       "\" id=\"mb049d957d1\" style=\"stroke:#d3d3d3;\"/>\n",
       "    </defs>\n",
       "    <g clip-path=\"url(#pc4dec3f07d)\">\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"117.992679\" xlink:href=\"#mb049d957d1\" y=\"209.108571\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"117.992679\" xlink:href=\"#mb049d957d1\" y=\"146.982857\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"117.992679\" xlink:href=\"#mb049d957d1\" y=\"84.857143\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"117.992679\" xlink:href=\"#mb049d957d1\" y=\"22.731429\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"180.118393\" xlink:href=\"#mb049d957d1\" y=\"209.108571\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"180.118393\" xlink:href=\"#mb049d957d1\" y=\"146.982857\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"180.118393\" xlink:href=\"#mb049d957d1\" y=\"84.857143\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"180.118393\" xlink:href=\"#mb049d957d1\" y=\"22.731429\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"242.244107\" xlink:href=\"#mb049d957d1\" y=\"209.108571\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"242.244107\" xlink:href=\"#mb049d957d1\" y=\"146.982857\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"242.244107\" xlink:href=\"#mb049d957d1\" y=\"84.857143\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"242.244107\" xlink:href=\"#mb049d957d1\" y=\"22.731429\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"304.369821\" xlink:href=\"#mb049d957d1\" y=\"209.108571\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"304.369821\" xlink:href=\"#mb049d957d1\" y=\"146.982857\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"304.369821\" xlink:href=\"#mb049d957d1\" y=\"84.857143\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"304.369821\" xlink:href=\"#mb049d957d1\" y=\"22.731429\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"PathCollection_2\">\n",
       "    <defs>\n",
       "     <path d=\"M 0 -3.535534 \n",
       "L -0.793777 -1.09254 \n",
       "L -3.362493 -1.09254 \n",
       "L -1.284358 0.417313 \n",
       "L -2.078135 2.860307 \n",
       "L -0 1.350454 \n",
       "L 2.078135 2.860307 \n",
       "L 1.284358 0.417313 \n",
       "L 3.362493 -1.09254 \n",
       "L 0.793777 -1.09254 \n",
       "z\n",
       "\" id=\"mb6ecbc6e2f\" style=\"stroke:#ff0000;\"/>\n",
       "    </defs>\n",
       "    <g clip-path=\"url(#pc4dec3f07d)\">\n",
       "     <use style=\"fill:#ff0000;stroke:#ff0000;\" x=\"117.992679\" xlink:href=\"#mb6ecbc6e2f\" y=\"209.108571\"/>\n",
       "     <use style=\"fill:#ff0000;stroke:#ff0000;\" x=\"117.992679\" xlink:href=\"#mb6ecbc6e2f\" y=\"146.982857\"/>\n",
       "     <use style=\"fill:#ff0000;stroke:#ff0000;\" x=\"117.992679\" xlink:href=\"#mb6ecbc6e2f\" y=\"84.857143\"/>\n",
       "     <use style=\"fill:#ff0000;stroke:#ff0000;\" x=\"117.992679\" xlink:href=\"#mb6ecbc6e2f\" y=\"22.731429\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"PathCollection_3\">\n",
       "    <defs>\n",
       "     <path d=\"M 0 1.767767 \n",
       "C 0.468817 1.767767 0.918496 1.581504 1.25 1.25 \n",
       "C 1.581504 0.918496 1.767767 0.468817 1.767767 0 \n",
       "C 1.767767 -0.468817 1.581504 -0.918496 1.25 -1.25 \n",
       "C 0.918496 -1.581504 0.468817 -1.767767 0 -1.767767 \n",
       "C -0.468817 -1.767767 -0.918496 -1.581504 -1.25 -1.25 \n",
       "C -1.581504 -0.918496 -1.767767 -0.468817 -1.767767 0 \n",
       "C -1.767767 0.468817 -1.581504 0.918496 -1.25 1.25 \n",
       "C -0.918496 1.581504 -0.468817 1.767767 0 1.767767 \n",
       "z\n",
       "\" id=\"m522cf6b9a4\" style=\"stroke:#0000ff;\"/>\n",
       "    </defs>\n",
       "    <g clip-path=\"url(#pc4dec3f07d)\">\n",
       "     <use style=\"fill:#0000ff;stroke:#0000ff;\" x=\"117.992679\" xlink:href=\"#m522cf6b9a4\" y=\"22.731429\"/>\n",
       "     <use style=\"fill:#0000ff;stroke:#0000ff;\" x=\"180.118393\" xlink:href=\"#m522cf6b9a4\" y=\"22.731429\"/>\n",
       "     <use style=\"fill:#0000ff;stroke:#0000ff;\" x=\"242.244107\" xlink:href=\"#m522cf6b9a4\" y=\"22.731429\"/>\n",
       "     <use style=\"fill:#0000ff;stroke:#0000ff;\" x=\"304.369821\" xlink:href=\"#m522cf6b9a4\" y=\"22.731429\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L 0 3.5 \n",
       "\" id=\"mc321f0140e\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"86.929821\" xlink:href=\"#mc321f0140e\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- 0 -->\n",
       "      <g transform=\"translate(83.748571 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2034 4250 \n",
       "Q 1547 4250 1301 3770 \n",
       "Q 1056 3291 1056 2328 \n",
       "Q 1056 1369 1301 889 \n",
       "Q 1547 409 2034 409 \n",
       "Q 2525 409 2770 889 \n",
       "Q 3016 1369 3016 2328 \n",
       "Q 3016 3291 2770 3770 \n",
       "Q 2525 4250 2034 4250 \n",
       "z\n",
       "M 2034 4750 \n",
       "Q 2819 4750 3233 4129 \n",
       "Q 3647 3509 3647 2328 \n",
       "Q 3647 1150 3233 529 \n",
       "Q 2819 -91 2034 -91 \n",
       "Q 1250 -91 836 529 \n",
       "Q 422 1150 422 2328 \n",
       "Q 422 3509 836 4129 \n",
       "Q 1250 4750 2034 4750 \n",
       "z\n",
       "\" id=\"DejaVuSans-30\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_2\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"149.055536\" xlink:href=\"#mc321f0140e\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- 1 -->\n",
       "      <g transform=\"translate(145.874286 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 794 531 \n",
       "L 1825 531 \n",
       "L 1825 4091 \n",
       "L 703 3866 \n",
       "L 703 4441 \n",
       "L 1819 4666 \n",
       "L 2450 4666 \n",
       "L 2450 531 \n",
       "L 3481 531 \n",
       "L 3481 0 \n",
       "L 794 0 \n",
       "L 794 531 \n",
       "z\n",
       "\" id=\"DejaVuSans-31\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"211.18125\" xlink:href=\"#mc321f0140e\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- 2 -->\n",
       "      <g transform=\"translate(208 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 1228 531 \n",
       "L 3431 531 \n",
       "L 3431 0 \n",
       "L 469 0 \n",
       "L 469 531 \n",
       "Q 828 903 1448 1529 \n",
       "Q 2069 2156 2228 2338 \n",
       "Q 2531 2678 2651 2914 \n",
       "Q 2772 3150 2772 3378 \n",
       "Q 2772 3750 2511 3984 \n",
       "Q 2250 4219 1831 4219 \n",
       "Q 1534 4219 1204 4116 \n",
       "Q 875 4013 500 3803 \n",
       "L 500 4441 \n",
       "Q 881 4594 1212 4672 \n",
       "Q 1544 4750 1819 4750 \n",
       "Q 2544 4750 2975 4387 \n",
       "Q 3406 4025 3406 3419 \n",
       "Q 3406 3131 3298 2873 \n",
       "Q 3191 2616 2906 2266 \n",
       "Q 2828 2175 2409 1742 \n",
       "Q 1991 1309 1228 531 \n",
       "z\n",
       "\" id=\"DejaVuSans-32\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_4\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"273.306964\" xlink:href=\"#mc321f0140e\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_4\">\n",
       "      <!-- 3 -->\n",
       "      <g transform=\"translate(270.125714 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2597 2516 \n",
       "Q 3050 2419 3304 2112 \n",
       "Q 3559 1806 3559 1356 \n",
       "Q 3559 666 3084 287 \n",
       "Q 2609 -91 1734 -91 \n",
       "Q 1441 -91 1130 -33 \n",
       "Q 819 25 488 141 \n",
       "L 488 750 \n",
       "Q 750 597 1062 519 \n",
       "Q 1375 441 1716 441 \n",
       "Q 2309 441 2620 675 \n",
       "Q 2931 909 2931 1356 \n",
       "Q 2931 1769 2642 2001 \n",
       "Q 2353 2234 1838 2234 \n",
       "L 1294 2234 \n",
       "L 1294 2753 \n",
       "L 1863 2753 \n",
       "Q 2328 2753 2575 2939 \n",
       "Q 2822 3125 2822 3475 \n",
       "Q 2822 3834 2567 4026 \n",
       "Q 2313 4219 1838 4219 \n",
       "Q 1578 4219 1281 4162 \n",
       "Q 984 4106 628 3988 \n",
       "L 628 4550 \n",
       "Q 988 4650 1302 4700 \n",
       "Q 1616 4750 1894 4750 \n",
       "Q 2613 4750 3031 4423 \n",
       "Q 3450 4097 3450 3541 \n",
       "Q 3450 3153 3228 2886 \n",
       "Q 3006 2619 2597 2516 \n",
       "z\n",
       "\" id=\"DejaVuSans-33\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"335.432679\" xlink:href=\"#mc321f0140e\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- 4 -->\n",
       "      <g transform=\"translate(332.251429 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2419 4116 \n",
       "L 825 1625 \n",
       "L 2419 1625 \n",
       "L 2419 4116 \n",
       "z\n",
       "M 2253 4666 \n",
       "L 3047 4666 \n",
       "L 3047 1625 \n",
       "L 3713 1625 \n",
       "L 3713 1100 \n",
       "L 3047 1100 \n",
       "L 3047 0 \n",
       "L 2419 0 \n",
       "L 2419 1100 \n",
       "L 313 1100 \n",
       "L 313 1709 \n",
       "L 2253 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-34\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-34\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_6\">\n",
       "     <!-- X -->\n",
       "     <g transform=\"translate(207.75625 252.916562)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M 403 4666 \n",
       "L 1081 4666 \n",
       "L 2241 2931 \n",
       "L 3406 4666 \n",
       "L 4084 4666 \n",
       "L 2584 2425 \n",
       "L 4184 0 \n",
       "L 3506 0 \n",
       "L 2194 1984 \n",
       "L 872 0 \n",
       "L 191 0 \n",
       "L 1856 2491 \n",
       "L 403 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-58\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-58\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_6\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L -3.5 0 \n",
       "\" id=\"m347f9378a5\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#m347f9378a5\" y=\"209.108571\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_7\">\n",
       "      <!-- 0.5 -->\n",
       "      <g transform=\"translate(20.878125 212.90779)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 684 794 \n",
       "L 1344 794 \n",
       "L 1344 0 \n",
       "L 684 0 \n",
       "L 684 794 \n",
       "z\n",
       "\" id=\"DejaVuSans-2e\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 691 4666 \n",
       "L 3169 4666 \n",
       "L 3169 4134 \n",
       "L 1269 4134 \n",
       "L 1269 2991 \n",
       "Q 1406 3038 1543 3061 \n",
       "Q 1681 3084 1819 3084 \n",
       "Q 2600 3084 3056 2656 \n",
       "Q 3513 2228 3513 1497 \n",
       "Q 3513 744 3044 326 \n",
       "Q 2575 -91 1722 -91 \n",
       "Q 1428 -91 1123 -41 \n",
       "Q 819 9 494 109 \n",
       "L 494 744 \n",
       "Q 775 591 1075 516 \n",
       "Q 1375 441 1709 441 \n",
       "Q 2250 441 2565 725 \n",
       "Q 2881 1009 2881 1497 \n",
       "Q 2881 1984 2565 2268 \n",
       "Q 2250 2553 1709 2553 \n",
       "Q 1456 2553 1204 2497 \n",
       "Q 953 2441 691 2322 \n",
       "L 691 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-35\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_7\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#m347f9378a5\" y=\"178.045714\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_8\">\n",
       "      <!-- 1.0 -->\n",
       "      <g transform=\"translate(20.878125 181.844933)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_8\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#m347f9378a5\" y=\"146.982857\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_9\">\n",
       "      <!-- 1.5 -->\n",
       "      <g transform=\"translate(20.878125 150.782076)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_9\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#m347f9378a5\" y=\"115.92\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_10\">\n",
       "      <!-- 2.0 -->\n",
       "      <g transform=\"translate(20.878125 119.719219)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_5\">\n",
       "     <g id=\"line2d_10\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#m347f9378a5\" y=\"84.857143\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_11\">\n",
       "      <!-- 2.5 -->\n",
       "      <g transform=\"translate(20.878125 88.656362)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_6\">\n",
       "     <g id=\"line2d_11\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#m347f9378a5\" y=\"53.794286\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_12\">\n",
       "      <!-- 3.0 -->\n",
       "      <g transform=\"translate(20.878125 57.593504)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_7\">\n",
       "     <g id=\"line2d_12\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#m347f9378a5\" y=\"22.731429\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_13\">\n",
       "      <!-- 3.5 -->\n",
       "      <g transform=\"translate(20.878125 26.530647)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_14\">\n",
       "     <!-- Y -->\n",
       "     <g transform=\"translate(14.798438 118.973906)rotate(-90)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M -13 4666 \n",
       "L 666 4666 \n",
       "L 1959 2747 \n",
       "L 3244 4666 \n",
       "L 3922 4666 \n",
       "L 2272 2222 \n",
       "L 2272 0 \n",
       "L 1638 0 \n",
       "L 1638 2222 \n",
       "L -13 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-59\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-59\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"LineCollection_1\">\n",
       "    <path clip-path=\"url(#pc4dec3f07d)\" d=\"M 117.992679 209.108571 \n",
       "L 117.992679 146.982857 \n",
       "\" style=\"fill:none;stroke:#0000ff;\"/>\n",
       "    <path clip-path=\"url(#pc4dec3f07d)\" d=\"M 117.992679 146.982857 \n",
       "L 117.992679 84.857143 \n",
       "\" style=\"fill:none;stroke:#0000ff;\"/>\n",
       "    <path clip-path=\"url(#pc4dec3f07d)\" d=\"M 117.992679 84.857143 \n",
       "L 117.992679 22.731429 \n",
       "\" style=\"fill:none;stroke:#0000ff;\"/>\n",
       "    <path clip-path=\"url(#pc4dec3f07d)\" d=\"M 180.118393 84.857143 \n",
       "L 180.118393 22.731429 \n",
       "\" style=\"fill:none;stroke:#0000ff;\"/>\n",
       "    <path clip-path=\"url(#pc4dec3f07d)\" d=\"M 242.244107 84.857143 \n",
       "L 242.244107 22.731429 \n",
       "\" style=\"fill:none;stroke:#0000ff;\"/>\n",
       "    <path clip-path=\"url(#pc4dec3f07d)\" d=\"M 304.369821 84.857143 \n",
       "L 304.369821 22.731429 \n",
       "\" style=\"fill:none;stroke:#0000ff;\"/>\n",
       "    <path clip-path=\"url(#pc4dec3f07d)\" d=\"M 117.992679 209.108571 \n",
       "L 180.118393 209.108571 \n",
       "\" style=\"fill:none;stroke:#0000ff;\"/>\n",
       "    <path clip-path=\"url(#pc4dec3f07d)\" d=\"M 117.992679 146.982857 \n",
       "L 180.118393 146.982857 \n",
       "\" style=\"fill:none;stroke:#0000ff;\"/>\n",
       "    <path clip-path=\"url(#pc4dec3f07d)\" d=\"M 117.992679 84.857143 \n",
       "L 180.118393 84.857143 \n",
       "\" style=\"fill:none;stroke:#0000ff;\"/>\n",
       "    <path clip-path=\"url(#pc4dec3f07d)\" d=\"M 117.992679 22.731429 \n",
       "L 180.118393 22.731429 \n",
       "\" style=\"fill:none;stroke:#0000ff;\"/>\n",
       "    <path clip-path=\"url(#pc4dec3f07d)\" d=\"M 180.118393 22.731429 \n",
       "L 242.244107 22.731429 \n",
       "\" style=\"fill:none;stroke:#0000ff;\"/>\n",
       "    <path clip-path=\"url(#pc4dec3f07d)\" d=\"M 242.244107 22.731429 \n",
       "L 304.369821 22.731429 \n",
       "\" style=\"fill:none;stroke:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path d=\"M 43.78125 224.64 \n",
       "L 43.78125 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path d=\"M 378.58125 224.64 \n",
       "L 378.58125 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path d=\"M 43.78125 224.64 \n",
       "L 378.58125 224.64 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path d=\"M 43.78125 7.2 \n",
       "L 378.58125 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"pc4dec3f07d\">\n",
       "   <rect height=\"217.44\" width=\"334.8\" x=\"43.78125\" y=\"7.2\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax = plt.subplots()\n",
    "op.topotools.plot_connections(pn, Ts, ax=ax)\n",
    "op.topotools.plot_coordinates(pn, pn.Ps, c='lightgrey', \n",
    "                              markersize=50, ax=ax)\n",
    "op.topotools.plot_coordinates(pn, P_left, c='red', \n",
    "                              markersize=50, marker='*', ax=ax)\n",
    "op.topotools.plot_coordinates(pn, P_bottom, c='blue', \n",
    "                              markersize=50, marker='.', ax=ax)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Find Common Neighbors: XNOR\n",
    "> *Finds throats shared by input pores only*"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2021-06-24T11:25:20.864635Z",
     "iopub.status.busy": "2021-06-24T11:25:20.863500Z",
     "iopub.status.idle": "2021-06-24T11:25:20.866059Z",
     "shell.execute_reply": "2021-06-24T11:25:20.867152Z"
    }
   },
   "outputs": [],
   "source": [
    "Ps = pn.pores(['left', 'back'])\n",
    "Ts = pn.find_neighbor_throats(pores=Ps, mode='xnor')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2021-06-24T11:25:20.903239Z",
     "iopub.status.busy": "2021-06-24T11:25:20.894711Z",
     "iopub.status.idle": "2021-06-24T11:25:21.014770Z",
     "shell.execute_reply": "2021-06-24T11:25:21.016003Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x1c20126ed60>"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<svg height=\"262.19625pt\" version=\"1.1\" viewBox=\"0 0 385.78125 262.19625\" width=\"385.78125pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:date>2021-06-24T07:25:20.978566</dc:date>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Matplotlib v3.4.2, https://matplotlib.org/</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 262.19625 \n",
       "L 385.78125 262.19625 \n",
       "L 385.78125 0 \n",
       "L 0 0 \n",
       "z\n",
       "\" style=\"fill:none;\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 43.78125 224.64 \n",
       "L 378.58125 224.64 \n",
       "L 378.58125 7.2 \n",
       "L 43.78125 7.2 \n",
       "z\n",
       "\" style=\"fill:#ffffff;\"/>\n",
       "   </g>\n",
       "   <g id=\"PathCollection_1\">\n",
       "    <defs>\n",
       "     <path d=\"M 0 3.535534 \n",
       "C 0.937635 3.535534 1.836992 3.163008 2.5 2.5 \n",
       "C 3.163008 1.836992 3.535534 0.937635 3.535534 0 \n",
       "C 3.535534 -0.937635 3.163008 -1.836992 2.5 -2.5 \n",
       "C 1.836992 -3.163008 0.937635 -3.535534 0 -3.535534 \n",
       "C -0.937635 -3.535534 -1.836992 -3.163008 -2.5 -2.5 \n",
       "C -3.163008 -1.836992 -3.535534 -0.937635 -3.535534 0 \n",
       "C -3.535534 0.937635 -3.163008 1.836992 -2.5 2.5 \n",
       "C -1.836992 3.163008 -0.937635 3.535534 0 3.535534 \n",
       "z\n",
       "\" id=\"m817c5c1f90\" style=\"stroke:#d3d3d3;\"/>\n",
       "    </defs>\n",
       "    <g clip-path=\"url(#p9e77661d5f)\">\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"117.992679\" xlink:href=\"#m817c5c1f90\" y=\"209.108571\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"117.992679\" xlink:href=\"#m817c5c1f90\" y=\"146.982857\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"117.992679\" xlink:href=\"#m817c5c1f90\" y=\"84.857143\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"117.992679\" xlink:href=\"#m817c5c1f90\" y=\"22.731429\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"180.118393\" xlink:href=\"#m817c5c1f90\" y=\"209.108571\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"180.118393\" xlink:href=\"#m817c5c1f90\" y=\"146.982857\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"180.118393\" xlink:href=\"#m817c5c1f90\" y=\"84.857143\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"180.118393\" xlink:href=\"#m817c5c1f90\" y=\"22.731429\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"242.244107\" xlink:href=\"#m817c5c1f90\" y=\"209.108571\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"242.244107\" xlink:href=\"#m817c5c1f90\" y=\"146.982857\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"242.244107\" xlink:href=\"#m817c5c1f90\" y=\"84.857143\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"242.244107\" xlink:href=\"#m817c5c1f90\" y=\"22.731429\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"304.369821\" xlink:href=\"#m817c5c1f90\" y=\"209.108571\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"304.369821\" xlink:href=\"#m817c5c1f90\" y=\"146.982857\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"304.369821\" xlink:href=\"#m817c5c1f90\" y=\"84.857143\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"304.369821\" xlink:href=\"#m817c5c1f90\" y=\"22.731429\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"PathCollection_2\">\n",
       "    <defs>\n",
       "     <path d=\"M 0 -3.535534 \n",
       "L -0.793777 -1.09254 \n",
       "L -3.362493 -1.09254 \n",
       "L -1.284358 0.417313 \n",
       "L -2.078135 2.860307 \n",
       "L -0 1.350454 \n",
       "L 2.078135 2.860307 \n",
       "L 1.284358 0.417313 \n",
       "L 3.362493 -1.09254 \n",
       "L 0.793777 -1.09254 \n",
       "z\n",
       "\" id=\"m9df6bd0fe2\" style=\"stroke:#ff0000;\"/>\n",
       "    </defs>\n",
       "    <g clip-path=\"url(#p9e77661d5f)\">\n",
       "     <use style=\"fill:#ff0000;stroke:#ff0000;\" x=\"117.992679\" xlink:href=\"#m9df6bd0fe2\" y=\"209.108571\"/>\n",
       "     <use style=\"fill:#ff0000;stroke:#ff0000;\" x=\"117.992679\" xlink:href=\"#m9df6bd0fe2\" y=\"146.982857\"/>\n",
       "     <use style=\"fill:#ff0000;stroke:#ff0000;\" x=\"117.992679\" xlink:href=\"#m9df6bd0fe2\" y=\"84.857143\"/>\n",
       "     <use style=\"fill:#ff0000;stroke:#ff0000;\" x=\"117.992679\" xlink:href=\"#m9df6bd0fe2\" y=\"22.731429\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"PathCollection_3\">\n",
       "    <defs>\n",
       "     <path d=\"M 0 1.767767 \n",
       "C 0.468817 1.767767 0.918496 1.581504 1.25 1.25 \n",
       "C 1.581504 0.918496 1.767767 0.468817 1.767767 0 \n",
       "C 1.767767 -0.468817 1.581504 -0.918496 1.25 -1.25 \n",
       "C 0.918496 -1.581504 0.468817 -1.767767 0 -1.767767 \n",
       "C -0.468817 -1.767767 -0.918496 -1.581504 -1.25 -1.25 \n",
       "C -1.581504 -0.918496 -1.767767 -0.468817 -1.767767 0 \n",
       "C -1.767767 0.468817 -1.581504 0.918496 -1.25 1.25 \n",
       "C -0.918496 1.581504 -0.468817 1.767767 0 1.767767 \n",
       "z\n",
       "\" id=\"m16c997190c\" style=\"stroke:#0000ff;\"/>\n",
       "    </defs>\n",
       "    <g clip-path=\"url(#p9e77661d5f)\">\n",
       "     <use style=\"fill:#0000ff;stroke:#0000ff;\" x=\"117.992679\" xlink:href=\"#m16c997190c\" y=\"22.731429\"/>\n",
       "     <use style=\"fill:#0000ff;stroke:#0000ff;\" x=\"180.118393\" xlink:href=\"#m16c997190c\" y=\"22.731429\"/>\n",
       "     <use style=\"fill:#0000ff;stroke:#0000ff;\" x=\"242.244107\" xlink:href=\"#m16c997190c\" y=\"22.731429\"/>\n",
       "     <use style=\"fill:#0000ff;stroke:#0000ff;\" x=\"304.369821\" xlink:href=\"#m16c997190c\" y=\"22.731429\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L 0 3.5 \n",
       "\" id=\"m5e205bdfe6\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"86.929821\" xlink:href=\"#m5e205bdfe6\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- 0 -->\n",
       "      <g transform=\"translate(83.748571 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2034 4250 \n",
       "Q 1547 4250 1301 3770 \n",
       "Q 1056 3291 1056 2328 \n",
       "Q 1056 1369 1301 889 \n",
       "Q 1547 409 2034 409 \n",
       "Q 2525 409 2770 889 \n",
       "Q 3016 1369 3016 2328 \n",
       "Q 3016 3291 2770 3770 \n",
       "Q 2525 4250 2034 4250 \n",
       "z\n",
       "M 2034 4750 \n",
       "Q 2819 4750 3233 4129 \n",
       "Q 3647 3509 3647 2328 \n",
       "Q 3647 1150 3233 529 \n",
       "Q 2819 -91 2034 -91 \n",
       "Q 1250 -91 836 529 \n",
       "Q 422 1150 422 2328 \n",
       "Q 422 3509 836 4129 \n",
       "Q 1250 4750 2034 4750 \n",
       "z\n",
       "\" id=\"DejaVuSans-30\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_2\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"149.055536\" xlink:href=\"#m5e205bdfe6\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- 1 -->\n",
       "      <g transform=\"translate(145.874286 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 794 531 \n",
       "L 1825 531 \n",
       "L 1825 4091 \n",
       "L 703 3866 \n",
       "L 703 4441 \n",
       "L 1819 4666 \n",
       "L 2450 4666 \n",
       "L 2450 531 \n",
       "L 3481 531 \n",
       "L 3481 0 \n",
       "L 794 0 \n",
       "L 794 531 \n",
       "z\n",
       "\" id=\"DejaVuSans-31\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"211.18125\" xlink:href=\"#m5e205bdfe6\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- 2 -->\n",
       "      <g transform=\"translate(208 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 1228 531 \n",
       "L 3431 531 \n",
       "L 3431 0 \n",
       "L 469 0 \n",
       "L 469 531 \n",
       "Q 828 903 1448 1529 \n",
       "Q 2069 2156 2228 2338 \n",
       "Q 2531 2678 2651 2914 \n",
       "Q 2772 3150 2772 3378 \n",
       "Q 2772 3750 2511 3984 \n",
       "Q 2250 4219 1831 4219 \n",
       "Q 1534 4219 1204 4116 \n",
       "Q 875 4013 500 3803 \n",
       "L 500 4441 \n",
       "Q 881 4594 1212 4672 \n",
       "Q 1544 4750 1819 4750 \n",
       "Q 2544 4750 2975 4387 \n",
       "Q 3406 4025 3406 3419 \n",
       "Q 3406 3131 3298 2873 \n",
       "Q 3191 2616 2906 2266 \n",
       "Q 2828 2175 2409 1742 \n",
       "Q 1991 1309 1228 531 \n",
       "z\n",
       "\" id=\"DejaVuSans-32\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_4\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"273.306964\" xlink:href=\"#m5e205bdfe6\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_4\">\n",
       "      <!-- 3 -->\n",
       "      <g transform=\"translate(270.125714 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2597 2516 \n",
       "Q 3050 2419 3304 2112 \n",
       "Q 3559 1806 3559 1356 \n",
       "Q 3559 666 3084 287 \n",
       "Q 2609 -91 1734 -91 \n",
       "Q 1441 -91 1130 -33 \n",
       "Q 819 25 488 141 \n",
       "L 488 750 \n",
       "Q 750 597 1062 519 \n",
       "Q 1375 441 1716 441 \n",
       "Q 2309 441 2620 675 \n",
       "Q 2931 909 2931 1356 \n",
       "Q 2931 1769 2642 2001 \n",
       "Q 2353 2234 1838 2234 \n",
       "L 1294 2234 \n",
       "L 1294 2753 \n",
       "L 1863 2753 \n",
       "Q 2328 2753 2575 2939 \n",
       "Q 2822 3125 2822 3475 \n",
       "Q 2822 3834 2567 4026 \n",
       "Q 2313 4219 1838 4219 \n",
       "Q 1578 4219 1281 4162 \n",
       "Q 984 4106 628 3988 \n",
       "L 628 4550 \n",
       "Q 988 4650 1302 4700 \n",
       "Q 1616 4750 1894 4750 \n",
       "Q 2613 4750 3031 4423 \n",
       "Q 3450 4097 3450 3541 \n",
       "Q 3450 3153 3228 2886 \n",
       "Q 3006 2619 2597 2516 \n",
       "z\n",
       "\" id=\"DejaVuSans-33\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"335.432679\" xlink:href=\"#m5e205bdfe6\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- 4 -->\n",
       "      <g transform=\"translate(332.251429 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2419 4116 \n",
       "L 825 1625 \n",
       "L 2419 1625 \n",
       "L 2419 4116 \n",
       "z\n",
       "M 2253 4666 \n",
       "L 3047 4666 \n",
       "L 3047 1625 \n",
       "L 3713 1625 \n",
       "L 3713 1100 \n",
       "L 3047 1100 \n",
       "L 3047 0 \n",
       "L 2419 0 \n",
       "L 2419 1100 \n",
       "L 313 1100 \n",
       "L 313 1709 \n",
       "L 2253 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-34\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-34\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_6\">\n",
       "     <!-- X -->\n",
       "     <g transform=\"translate(207.75625 252.916562)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M 403 4666 \n",
       "L 1081 4666 \n",
       "L 2241 2931 \n",
       "L 3406 4666 \n",
       "L 4084 4666 \n",
       "L 2584 2425 \n",
       "L 4184 0 \n",
       "L 3506 0 \n",
       "L 2194 1984 \n",
       "L 872 0 \n",
       "L 191 0 \n",
       "L 1856 2491 \n",
       "L 403 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-58\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-58\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_6\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L -3.5 0 \n",
       "\" id=\"mf361215ba2\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#mf361215ba2\" y=\"209.108571\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_7\">\n",
       "      <!-- 0.5 -->\n",
       "      <g transform=\"translate(20.878125 212.90779)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 684 794 \n",
       "L 1344 794 \n",
       "L 1344 0 \n",
       "L 684 0 \n",
       "L 684 794 \n",
       "z\n",
       "\" id=\"DejaVuSans-2e\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 691 4666 \n",
       "L 3169 4666 \n",
       "L 3169 4134 \n",
       "L 1269 4134 \n",
       "L 1269 2991 \n",
       "Q 1406 3038 1543 3061 \n",
       "Q 1681 3084 1819 3084 \n",
       "Q 2600 3084 3056 2656 \n",
       "Q 3513 2228 3513 1497 \n",
       "Q 3513 744 3044 326 \n",
       "Q 2575 -91 1722 -91 \n",
       "Q 1428 -91 1123 -41 \n",
       "Q 819 9 494 109 \n",
       "L 494 744 \n",
       "Q 775 591 1075 516 \n",
       "Q 1375 441 1709 441 \n",
       "Q 2250 441 2565 725 \n",
       "Q 2881 1009 2881 1497 \n",
       "Q 2881 1984 2565 2268 \n",
       "Q 2250 2553 1709 2553 \n",
       "Q 1456 2553 1204 2497 \n",
       "Q 953 2441 691 2322 \n",
       "L 691 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-35\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_7\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#mf361215ba2\" y=\"178.045714\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_8\">\n",
       "      <!-- 1.0 -->\n",
       "      <g transform=\"translate(20.878125 181.844933)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_8\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#mf361215ba2\" y=\"146.982857\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_9\">\n",
       "      <!-- 1.5 -->\n",
       "      <g transform=\"translate(20.878125 150.782076)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_9\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#mf361215ba2\" y=\"115.92\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_10\">\n",
       "      <!-- 2.0 -->\n",
       "      <g transform=\"translate(20.878125 119.719219)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_5\">\n",
       "     <g id=\"line2d_10\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#mf361215ba2\" y=\"84.857143\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_11\">\n",
       "      <!-- 2.5 -->\n",
       "      <g transform=\"translate(20.878125 88.656362)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_6\">\n",
       "     <g id=\"line2d_11\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#mf361215ba2\" y=\"53.794286\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_12\">\n",
       "      <!-- 3.0 -->\n",
       "      <g transform=\"translate(20.878125 57.593504)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_7\">\n",
       "     <g id=\"line2d_12\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#mf361215ba2\" y=\"22.731429\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_13\">\n",
       "      <!-- 3.5 -->\n",
       "      <g transform=\"translate(20.878125 26.530647)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_14\">\n",
       "     <!-- Y -->\n",
       "     <g transform=\"translate(14.798438 118.973906)rotate(-90)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M -13 4666 \n",
       "L 666 4666 \n",
       "L 1959 2747 \n",
       "L 3244 4666 \n",
       "L 3922 4666 \n",
       "L 2272 2222 \n",
       "L 2272 0 \n",
       "L 1638 0 \n",
       "L 1638 2222 \n",
       "L -13 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-59\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-59\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"LineCollection_1\">\n",
       "    <path clip-path=\"url(#p9e77661d5f)\" d=\"M 117.992679 209.108571 \n",
       "L 117.992679 146.982857 \n",
       "\" style=\"fill:none;stroke:#0000ff;\"/>\n",
       "    <path clip-path=\"url(#p9e77661d5f)\" d=\"M 117.992679 146.982857 \n",
       "L 117.992679 84.857143 \n",
       "\" style=\"fill:none;stroke:#0000ff;\"/>\n",
       "    <path clip-path=\"url(#p9e77661d5f)\" d=\"M 117.992679 84.857143 \n",
       "L 117.992679 22.731429 \n",
       "\" style=\"fill:none;stroke:#0000ff;\"/>\n",
       "    <path clip-path=\"url(#p9e77661d5f)\" d=\"M 117.992679 22.731429 \n",
       "L 180.118393 22.731429 \n",
       "\" style=\"fill:none;stroke:#0000ff;\"/>\n",
       "    <path clip-path=\"url(#p9e77661d5f)\" d=\"M 180.118393 22.731429 \n",
       "L 242.244107 22.731429 \n",
       "\" style=\"fill:none;stroke:#0000ff;\"/>\n",
       "    <path clip-path=\"url(#p9e77661d5f)\" d=\"M 242.244107 22.731429 \n",
       "L 304.369821 22.731429 \n",
       "\" style=\"fill:none;stroke:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path d=\"M 43.78125 224.64 \n",
       "L 43.78125 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path d=\"M 378.58125 224.64 \n",
       "L 378.58125 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path d=\"M 43.78125 224.64 \n",
       "L 378.58125 224.64 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path d=\"M 43.78125 7.2 \n",
       "L 378.58125 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"p9e77661d5f\">\n",
       "   <rect height=\"217.44\" width=\"334.8\" x=\"43.78125\" y=\"7.2\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax = plt.subplots()\n",
    "op.topotools.plot_connections(pn, Ts, ax=ax)\n",
    "op.topotools.plot_coordinates(pn, pn.Ps, c='lightgrey', \n",
    "                              markersize=50, ax=ax)\n",
    "op.topotools.plot_coordinates(pn, P_left, c='red', \n",
    "                              markersize=50, marker='*', ax=ax)\n",
    "op.topotools.plot_coordinates(pn, P_bottom, c='blue', \n",
    "                              markersize=50, marker='.', ax=ax)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### Find Non-Shared Neighbors: XOR\n",
    "> *Finds throats that are only connected to one input pore*"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2021-06-24T11:25:21.023132Z",
     "iopub.status.busy": "2021-06-24T11:25:21.021608Z",
     "iopub.status.idle": "2021-06-24T11:25:21.025705Z",
     "shell.execute_reply": "2021-06-24T11:25:21.024309Z"
    }
   },
   "outputs": [],
   "source": [
    "Ps = pn.pores(['left', 'back'])\n",
    "Ts = pn.find_neighbor_throats(pores=Ps, mode='xor')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "execution": {
     "iopub.execute_input": "2021-06-24T11:25:21.058781Z",
     "iopub.status.busy": "2021-06-24T11:25:21.056282Z",
     "iopub.status.idle": "2021-06-24T11:25:21.175064Z",
     "shell.execute_reply": "2021-06-24T11:25:21.176197Z"
    }
   },
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x1c2012ddee0>"
      ]
     },
     "execution_count": 1,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<svg height=\"262.19625pt\" version=\"1.1\" viewBox=\"0 0 385.78125 262.19625\" width=\"385.78125pt\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\">\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:date>2021-06-24T07:25:21.138826</dc:date>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Matplotlib v3.4.2, https://matplotlib.org/</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linecap:butt;stroke-linejoin:round;}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 262.19625 \n",
       "L 385.78125 262.19625 \n",
       "L 385.78125 0 \n",
       "L 0 0 \n",
       "z\n",
       "\" style=\"fill:none;\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 43.78125 224.64 \n",
       "L 378.58125 224.64 \n",
       "L 378.58125 7.2 \n",
       "L 43.78125 7.2 \n",
       "z\n",
       "\" style=\"fill:#ffffff;\"/>\n",
       "   </g>\n",
       "   <g id=\"PathCollection_1\">\n",
       "    <defs>\n",
       "     <path d=\"M 0 3.535534 \n",
       "C 0.937635 3.535534 1.836992 3.163008 2.5 2.5 \n",
       "C 3.163008 1.836992 3.535534 0.937635 3.535534 0 \n",
       "C 3.535534 -0.937635 3.163008 -1.836992 2.5 -2.5 \n",
       "C 1.836992 -3.163008 0.937635 -3.535534 0 -3.535534 \n",
       "C -0.937635 -3.535534 -1.836992 -3.163008 -2.5 -2.5 \n",
       "C -3.163008 -1.836992 -3.535534 -0.937635 -3.535534 0 \n",
       "C -3.535534 0.937635 -3.163008 1.836992 -2.5 2.5 \n",
       "C -1.836992 3.163008 -0.937635 3.535534 0 3.535534 \n",
       "z\n",
       "\" id=\"m3109504687\" style=\"stroke:#d3d3d3;\"/>\n",
       "    </defs>\n",
       "    <g clip-path=\"url(#p6b12753e63)\">\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"117.992679\" xlink:href=\"#m3109504687\" y=\"209.108571\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"117.992679\" xlink:href=\"#m3109504687\" y=\"146.982857\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"117.992679\" xlink:href=\"#m3109504687\" y=\"84.857143\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"117.992679\" xlink:href=\"#m3109504687\" y=\"22.731429\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"180.118393\" xlink:href=\"#m3109504687\" y=\"209.108571\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"180.118393\" xlink:href=\"#m3109504687\" y=\"146.982857\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"180.118393\" xlink:href=\"#m3109504687\" y=\"84.857143\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"180.118393\" xlink:href=\"#m3109504687\" y=\"22.731429\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"242.244107\" xlink:href=\"#m3109504687\" y=\"209.108571\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"242.244107\" xlink:href=\"#m3109504687\" y=\"146.982857\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"242.244107\" xlink:href=\"#m3109504687\" y=\"84.857143\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"242.244107\" xlink:href=\"#m3109504687\" y=\"22.731429\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"304.369821\" xlink:href=\"#m3109504687\" y=\"209.108571\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"304.369821\" xlink:href=\"#m3109504687\" y=\"146.982857\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"304.369821\" xlink:href=\"#m3109504687\" y=\"84.857143\"/>\n",
       "     <use style=\"fill:#d3d3d3;stroke:#d3d3d3;\" x=\"304.369821\" xlink:href=\"#m3109504687\" y=\"22.731429\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"PathCollection_2\">\n",
       "    <defs>\n",
       "     <path d=\"M 0 -3.535534 \n",
       "L -0.793777 -1.09254 \n",
       "L -3.362493 -1.09254 \n",
       "L -1.284358 0.417313 \n",
       "L -2.078135 2.860307 \n",
       "L -0 1.350454 \n",
       "L 2.078135 2.860307 \n",
       "L 1.284358 0.417313 \n",
       "L 3.362493 -1.09254 \n",
       "L 0.793777 -1.09254 \n",
       "z\n",
       "\" id=\"m960bb241a8\" style=\"stroke:#ff0000;\"/>\n",
       "    </defs>\n",
       "    <g clip-path=\"url(#p6b12753e63)\">\n",
       "     <use style=\"fill:#ff0000;stroke:#ff0000;\" x=\"117.992679\" xlink:href=\"#m960bb241a8\" y=\"209.108571\"/>\n",
       "     <use style=\"fill:#ff0000;stroke:#ff0000;\" x=\"117.992679\" xlink:href=\"#m960bb241a8\" y=\"146.982857\"/>\n",
       "     <use style=\"fill:#ff0000;stroke:#ff0000;\" x=\"117.992679\" xlink:href=\"#m960bb241a8\" y=\"84.857143\"/>\n",
       "     <use style=\"fill:#ff0000;stroke:#ff0000;\" x=\"117.992679\" xlink:href=\"#m960bb241a8\" y=\"22.731429\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"PathCollection_3\">\n",
       "    <defs>\n",
       "     <path d=\"M 0 1.767767 \n",
       "C 0.468817 1.767767 0.918496 1.581504 1.25 1.25 \n",
       "C 1.581504 0.918496 1.767767 0.468817 1.767767 0 \n",
       "C 1.767767 -0.468817 1.581504 -0.918496 1.25 -1.25 \n",
       "C 0.918496 -1.581504 0.468817 -1.767767 0 -1.767767 \n",
       "C -0.468817 -1.767767 -0.918496 -1.581504 -1.25 -1.25 \n",
       "C -1.581504 -0.918496 -1.767767 -0.468817 -1.767767 0 \n",
       "C -1.767767 0.468817 -1.581504 0.918496 -1.25 1.25 \n",
       "C -0.918496 1.581504 -0.468817 1.767767 0 1.767767 \n",
       "z\n",
       "\" id=\"maf4f4fbd86\" style=\"stroke:#0000ff;\"/>\n",
       "    </defs>\n",
       "    <g clip-path=\"url(#p6b12753e63)\">\n",
       "     <use style=\"fill:#0000ff;stroke:#0000ff;\" x=\"117.992679\" xlink:href=\"#maf4f4fbd86\" y=\"22.731429\"/>\n",
       "     <use style=\"fill:#0000ff;stroke:#0000ff;\" x=\"180.118393\" xlink:href=\"#maf4f4fbd86\" y=\"22.731429\"/>\n",
       "     <use style=\"fill:#0000ff;stroke:#0000ff;\" x=\"242.244107\" xlink:href=\"#maf4f4fbd86\" y=\"22.731429\"/>\n",
       "     <use style=\"fill:#0000ff;stroke:#0000ff;\" x=\"304.369821\" xlink:href=\"#maf4f4fbd86\" y=\"22.731429\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L 0 3.5 \n",
       "\" id=\"mb401d040b8\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"86.929821\" xlink:href=\"#mb401d040b8\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- 0 -->\n",
       "      <g transform=\"translate(83.748571 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2034 4250 \n",
       "Q 1547 4250 1301 3770 \n",
       "Q 1056 3291 1056 2328 \n",
       "Q 1056 1369 1301 889 \n",
       "Q 1547 409 2034 409 \n",
       "Q 2525 409 2770 889 \n",
       "Q 3016 1369 3016 2328 \n",
       "Q 3016 3291 2770 3770 \n",
       "Q 2525 4250 2034 4250 \n",
       "z\n",
       "M 2034 4750 \n",
       "Q 2819 4750 3233 4129 \n",
       "Q 3647 3509 3647 2328 \n",
       "Q 3647 1150 3233 529 \n",
       "Q 2819 -91 2034 -91 \n",
       "Q 1250 -91 836 529 \n",
       "Q 422 1150 422 2328 \n",
       "Q 422 3509 836 4129 \n",
       "Q 1250 4750 2034 4750 \n",
       "z\n",
       "\" id=\"DejaVuSans-30\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_2\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"149.055536\" xlink:href=\"#mb401d040b8\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- 1 -->\n",
       "      <g transform=\"translate(145.874286 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 794 531 \n",
       "L 1825 531 \n",
       "L 1825 4091 \n",
       "L 703 3866 \n",
       "L 703 4441 \n",
       "L 1819 4666 \n",
       "L 2450 4666 \n",
       "L 2450 531 \n",
       "L 3481 531 \n",
       "L 3481 0 \n",
       "L 794 0 \n",
       "L 794 531 \n",
       "z\n",
       "\" id=\"DejaVuSans-31\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"211.18125\" xlink:href=\"#mb401d040b8\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- 2 -->\n",
       "      <g transform=\"translate(208 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 1228 531 \n",
       "L 3431 531 \n",
       "L 3431 0 \n",
       "L 469 0 \n",
       "L 469 531 \n",
       "Q 828 903 1448 1529 \n",
       "Q 2069 2156 2228 2338 \n",
       "Q 2531 2678 2651 2914 \n",
       "Q 2772 3150 2772 3378 \n",
       "Q 2772 3750 2511 3984 \n",
       "Q 2250 4219 1831 4219 \n",
       "Q 1534 4219 1204 4116 \n",
       "Q 875 4013 500 3803 \n",
       "L 500 4441 \n",
       "Q 881 4594 1212 4672 \n",
       "Q 1544 4750 1819 4750 \n",
       "Q 2544 4750 2975 4387 \n",
       "Q 3406 4025 3406 3419 \n",
       "Q 3406 3131 3298 2873 \n",
       "Q 3191 2616 2906 2266 \n",
       "Q 2828 2175 2409 1742 \n",
       "Q 1991 1309 1228 531 \n",
       "z\n",
       "\" id=\"DejaVuSans-32\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_4\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"273.306964\" xlink:href=\"#mb401d040b8\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_4\">\n",
       "      <!-- 3 -->\n",
       "      <g transform=\"translate(270.125714 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2597 2516 \n",
       "Q 3050 2419 3304 2112 \n",
       "Q 3559 1806 3559 1356 \n",
       "Q 3559 666 3084 287 \n",
       "Q 2609 -91 1734 -91 \n",
       "Q 1441 -91 1130 -33 \n",
       "Q 819 25 488 141 \n",
       "L 488 750 \n",
       "Q 750 597 1062 519 \n",
       "Q 1375 441 1716 441 \n",
       "Q 2309 441 2620 675 \n",
       "Q 2931 909 2931 1356 \n",
       "Q 2931 1769 2642 2001 \n",
       "Q 2353 2234 1838 2234 \n",
       "L 1294 2234 \n",
       "L 1294 2753 \n",
       "L 1863 2753 \n",
       "Q 2328 2753 2575 2939 \n",
       "Q 2822 3125 2822 3475 \n",
       "Q 2822 3834 2567 4026 \n",
       "Q 2313 4219 1838 4219 \n",
       "Q 1578 4219 1281 4162 \n",
       "Q 984 4106 628 3988 \n",
       "L 628 4550 \n",
       "Q 988 4650 1302 4700 \n",
       "Q 1616 4750 1894 4750 \n",
       "Q 2613 4750 3031 4423 \n",
       "Q 3450 4097 3450 3541 \n",
       "Q 3450 3153 3228 2886 \n",
       "Q 3006 2619 2597 2516 \n",
       "z\n",
       "\" id=\"DejaVuSans-33\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"335.432679\" xlink:href=\"#mb401d040b8\" y=\"224.64\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- 4 -->\n",
       "      <g transform=\"translate(332.251429 239.238437)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 2419 4116 \n",
       "L 825 1625 \n",
       "L 2419 1625 \n",
       "L 2419 4116 \n",
       "z\n",
       "M 2253 4666 \n",
       "L 3047 4666 \n",
       "L 3047 1625 \n",
       "L 3713 1625 \n",
       "L 3713 1100 \n",
       "L 3047 1100 \n",
       "L 3047 0 \n",
       "L 2419 0 \n",
       "L 2419 1100 \n",
       "L 313 1100 \n",
       "L 313 1709 \n",
       "L 2253 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-34\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-34\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_6\">\n",
       "     <!-- X -->\n",
       "     <g transform=\"translate(207.75625 252.916562)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M 403 4666 \n",
       "L 1081 4666 \n",
       "L 2241 2931 \n",
       "L 3406 4666 \n",
       "L 4084 4666 \n",
       "L 2584 2425 \n",
       "L 4184 0 \n",
       "L 3506 0 \n",
       "L 2194 1984 \n",
       "L 872 0 \n",
       "L 191 0 \n",
       "L 1856 2491 \n",
       "L 403 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-58\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-58\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_6\">\n",
       "      <defs>\n",
       "       <path d=\"M 0 0 \n",
       "L -3.5 0 \n",
       "\" id=\"mfd5c79ddba\" style=\"stroke:#000000;stroke-width:0.8;\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#mfd5c79ddba\" y=\"209.108571\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_7\">\n",
       "      <!-- 0.5 -->\n",
       "      <g transform=\"translate(20.878125 212.90779)scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path d=\"M 684 794 \n",
       "L 1344 794 \n",
       "L 1344 0 \n",
       "L 684 0 \n",
       "L 684 794 \n",
       "z\n",
       "\" id=\"DejaVuSans-2e\" transform=\"scale(0.015625)\"/>\n",
       "        <path d=\"M 691 4666 \n",
       "L 3169 4666 \n",
       "L 3169 4134 \n",
       "L 1269 4134 \n",
       "L 1269 2991 \n",
       "Q 1406 3038 1543 3061 \n",
       "Q 1681 3084 1819 3084 \n",
       "Q 2600 3084 3056 2656 \n",
       "Q 3513 2228 3513 1497 \n",
       "Q 3513 744 3044 326 \n",
       "Q 2575 -91 1722 -91 \n",
       "Q 1428 -91 1123 -41 \n",
       "Q 819 9 494 109 \n",
       "L 494 744 \n",
       "Q 775 591 1075 516 \n",
       "Q 1375 441 1709 441 \n",
       "Q 2250 441 2565 725 \n",
       "Q 2881 1009 2881 1497 \n",
       "Q 2881 1984 2565 2268 \n",
       "Q 2250 2553 1709 2553 \n",
       "Q 1456 2553 1204 2497 \n",
       "Q 953 2441 691 2322 \n",
       "L 691 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-35\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_7\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#mfd5c79ddba\" y=\"178.045714\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_8\">\n",
       "      <!-- 1.0 -->\n",
       "      <g transform=\"translate(20.878125 181.844933)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_8\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#mfd5c79ddba\" y=\"146.982857\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_9\">\n",
       "      <!-- 1.5 -->\n",
       "      <g transform=\"translate(20.878125 150.782076)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_9\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#mfd5c79ddba\" y=\"115.92\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_10\">\n",
       "      <!-- 2.0 -->\n",
       "      <g transform=\"translate(20.878125 119.719219)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_5\">\n",
       "     <g id=\"line2d_10\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#mfd5c79ddba\" y=\"84.857143\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_11\">\n",
       "      <!-- 2.5 -->\n",
       "      <g transform=\"translate(20.878125 88.656362)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_6\">\n",
       "     <g id=\"line2d_11\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#mfd5c79ddba\" y=\"53.794286\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_12\">\n",
       "      <!-- 3.0 -->\n",
       "      <g transform=\"translate(20.878125 57.593504)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_7\">\n",
       "     <g id=\"line2d_12\">\n",
       "      <g>\n",
       "       <use style=\"stroke:#000000;stroke-width:0.8;\" x=\"43.78125\" xlink:href=\"#mfd5c79ddba\" y=\"22.731429\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_13\">\n",
       "      <!-- 3.5 -->\n",
       "      <g transform=\"translate(20.878125 26.530647)scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "       <use x=\"63.623047\" xlink:href=\"#DejaVuSans-2e\"/>\n",
       "       <use x=\"95.410156\" xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_14\">\n",
       "     <!-- Y -->\n",
       "     <g transform=\"translate(14.798438 118.973906)rotate(-90)scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path d=\"M -13 4666 \n",
       "L 666 4666 \n",
       "L 1959 2747 \n",
       "L 3244 4666 \n",
       "L 3922 4666 \n",
       "L 2272 2222 \n",
       "L 2272 0 \n",
       "L 1638 0 \n",
       "L 1638 2222 \n",
       "L -13 4666 \n",
       "z\n",
       "\" id=\"DejaVuSans-59\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-59\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"LineCollection_1\">\n",
       "    <path clip-path=\"url(#p6b12753e63)\" d=\"M 180.118393 84.857143 \n",
       "L 180.118393 22.731429 \n",
       "\" style=\"fill:none;stroke:#0000ff;\"/>\n",
       "    <path clip-path=\"url(#p6b12753e63)\" d=\"M 242.244107 84.857143 \n",
       "L 242.244107 22.731429 \n",
       "\" style=\"fill:none;stroke:#0000ff;\"/>\n",
       "    <path clip-path=\"url(#p6b12753e63)\" d=\"M 304.369821 84.857143 \n",
       "L 304.369821 22.731429 \n",
       "\" style=\"fill:none;stroke:#0000ff;\"/>\n",
       "    <path clip-path=\"url(#p6b12753e63)\" d=\"M 117.992679 209.108571 \n",
       "L 180.118393 209.108571 \n",
       "\" style=\"fill:none;stroke:#0000ff;\"/>\n",
       "    <path clip-path=\"url(#p6b12753e63)\" d=\"M 117.992679 146.982857 \n",
       "L 180.118393 146.982857 \n",
       "\" style=\"fill:none;stroke:#0000ff;\"/>\n",
       "    <path clip-path=\"url(#p6b12753e63)\" d=\"M 117.992679 84.857143 \n",
       "L 180.118393 84.857143 \n",
       "\" style=\"fill:none;stroke:#0000ff;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path d=\"M 43.78125 224.64 \n",
       "L 43.78125 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path d=\"M 378.58125 224.64 \n",
       "L 378.58125 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path d=\"M 43.78125 224.64 \n",
       "L 378.58125 224.64 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path d=\"M 43.78125 7.2 \n",
       "L 378.58125 7.2 \n",
       "\" style=\"fill:none;stroke:#000000;stroke-linecap:square;stroke-linejoin:miter;stroke-width:0.8;\"/>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"p6b12753e63\">\n",
       "   <rect height=\"217.44\" width=\"334.8\" x=\"43.78125\" y=\"7.2\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax = plt.subplots()\n",
    "op.topotools.plot_connections(pn, Ts, ax=ax)\n",
    "op.topotools.plot_coordinates(pn, pn.Ps, c='lightgrey', \n",
    "                              markersize=50, ax=ax)\n",
    "op.topotools.plot_coordinates(pn, P_left, c='red', \n",
    "                              markersize=50, marker='*', ax=ax)\n",
    "op.topotools.plot_coordinates(pn, P_bottom, c='blue', \n",
    "                              markersize=50, marker='.', ax=ax)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.10"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {},
   "number_sections": false,
   "sideBar": true,
   "skip_h1_title": true,
   "title_cell": "",
   "title_sidebar": "Contents",
   "toc_cell": true,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
